Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Antti Väyrynen
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 81e98ebc
authored
May 13, 2013
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove superadmin setter and change it to immutable in jpa
1 parent
96d412c4
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
6 additions
and
25 deletions
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/BootstrapBean.java
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/TestDataBean.java
code/MoyaDatabase/src/fi/codecrew/moya/model/EventUser.java
code/MoyaDatabase/src/fi/codecrew/moya/model/IUser.java
code/MoyaDatabase/src/fi/codecrew/moya/model/User.java
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/BootstrapBean.java
View file @
81e98eb
...
...
@@ -5,7 +5,6 @@ import javax.ejb.LocalBean;
import
javax.ejb.Stateless
;
import
fi.codecrew.moya.facade.UserFacade
;
import
fi.codecrew.moya.beans.BootstrapBeanLocal
;
import
fi.codecrew.moya.model.User
;
@Stateless
...
...
@@ -23,7 +22,7 @@ public class BootstrapBean implements BootstrapBeanLocal {
if
(
adminUser
==
null
)
{
adminUser
=
new
User
();
adminUser
.
setLogin
(
"admin"
);
adminUser
.
setSuperadmin
(
true
);
//
adminUser.setSuperadmin(true);
adminUser
.
resetPassword
(
"admin"
);
userFacade
.
create
(
adminUser
);
}
...
...
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/TestDataBean.java
View file @
81e98eb
...
...
@@ -21,8 +21,6 @@ import fi.codecrew.moya.facade.CompoFacade;
import
fi.codecrew.moya.facade.EventMapFacade
;
import
fi.codecrew.moya.facade.PlaceFacade
;
import
fi.codecrew.moya.facade.UserFacade
;
import
fi.codecrew.moya.beans.EventBeanLocal
;
import
fi.codecrew.moya.beans.TestDataBeanLocal
;
import
fi.codecrew.moya.model.Bill
;
import
fi.codecrew.moya.model.Compo
;
import
fi.codecrew.moya.model.CompoEntry
;
...
...
@@ -143,7 +141,7 @@ public class TestDataBean implements TestDataBeanLocal {
u
.
setTown
(
"Adminila"
);
u
.
setPostalTown
(
"Adminila "
);
u
.
setZip
(
"6666"
);
u
.
setSuperadmin
(
true
);
//
u.setSuperadmin(true);
userFacade
.
create
(
u
);
return
u
;
...
...
code/MoyaDatabase/src/fi/codecrew/moya/model/EventUser.java
View file @
81e98eb
...
...
@@ -104,9 +104,6 @@ public class EventUser extends GenericEntity {
@Temporal
(
TemporalType
.
TIMESTAMP
)
@Column
(
name
=
"createtime"
,
nullable
=
false
,
updatable
=
false
)
private
Date
eventuserCreated
;
public
EventUser
getCreator
()
{
return
creator
;
...
...
@@ -393,10 +390,6 @@ public class EventUser extends GenericEntity {
return
user
.
checkPassword
(
plainPassword
);
}
public
void
setSuperadmin
(
boolean
superadmin
)
{
user
.
setSuperadmin
(
superadmin
);
}
public
boolean
isSuperadmin
()
{
return
user
.
isSuperadmin
();
}
...
...
@@ -446,5 +439,4 @@ public class EventUser extends GenericEntity {
}
}
code/MoyaDatabase/src/fi/codecrew/moya/model/IUser.java
View file @
81e98eb
...
...
@@ -92,8 +92,6 @@ public interface IUser {
public
abstract
boolean
checkPassword
(
String
plainPassword
);
public
abstract
void
setSuperadmin
(
boolean
superadmin
);
public
abstract
boolean
isSuperadmin
();
public
abstract
void
setPostalTown
(
String
postalTown
);
...
...
code/MoyaDatabase/src/fi/codecrew/moya/model/User.java
View file @
81e98eb
...
...
@@ -103,14 +103,14 @@ public class User extends GenericEntity implements IUser {
@Temporal
(
TemporalType
.
TIMESTAMP
)
private
Calendar
confirmTime
;
@Column
(
name
=
"superadmin"
)
@Column
(
name
=
"superadmin"
,
updatable
=
false
)
private
boolean
superadmin
=
false
;
@OneToMany
(
mappedBy
=
"user"
,
cascade
=
CascadeType
.
ALL
)
@OrderBy
@PrivateOwned
private
List
<
UserImage
>
userImageList
;
@OneToMany
(
mappedBy
=
"user"
,
fetch
=
FetchType
.
LAZY
)
@OrderBy
()
private
List
<
LicenseCode
>
licenseCodes
;
...
...
@@ -310,11 +310,6 @@ public class User extends GenericEntity implements IUser {
}
@Override
public
void
setSuperadmin
(
boolean
superadmin
)
{
this
.
superadmin
=
superadmin
;
}
@Override
public
boolean
isSuperadmin
()
{
return
superadmin
;
}
...
...
@@ -359,12 +354,11 @@ public class User extends GenericEntity implements IUser {
}
return
isAnon
;
}
public
List
<
LicenseCode
>
getLicenseCodes
()
{
if
(
licenseCodes
==
null
)
if
(
licenseCodes
==
null
)
licenseCodes
=
new
ArrayList
<
LicenseCode
>();
return
licenseCodes
;
}
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment