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 9fe3835f
authored
May 12, 2012
by
Juho Juopperi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OrgRole to Role mapping
1 parent
4109b346
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
0 deletions
code/LanBortalDatabase/src/fi/insomnia/bortal/model/OrgRole.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Role.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/OrgRole.java
View file @
9fe3835
...
...
@@ -9,6 +9,7 @@ import javax.persistence.JoinColumn;
import
javax.persistence.JoinTable
;
import
javax.persistence.ManyToMany
;
import
javax.persistence.ManyToOne
;
import
javax.persistence.OneToMany
;
import
javax.persistence.Table
;
import
javax.persistence.UniqueConstraint
;
...
...
@@ -49,6 +50,9 @@ public class OrgRole extends GenericEntity {
@Column
(
nullable
=
false
)
@ManyToOne
()
private
EventOrganiser
eventOrganizer
;
@OneToMany
private
List
<
Role
>
eventRoles
;
public
OrgRole
()
{
super
();
...
...
@@ -94,4 +98,12 @@ public class OrgRole extends GenericEntity {
this
.
eventOrganizer
=
eventOrganizer
;
}
public
List
<
Role
>
getEventRoles
()
{
return
eventRoles
;
}
public
void
setEventRoles
(
List
<
Role
>
eventRoles
)
{
this
.
eventRoles
=
eventRoles
;
}
}
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Role.java
View file @
9fe3835
...
...
@@ -31,6 +31,8 @@ public class Role extends GenericEntity {
protected
static
final
String
NAME_COLUMN
=
"role_name"
;
protected
static
final
String
EVENT_ID_COLUMN
=
"event_id"
;
protected
static
final
String
ORG_ROLE_ID_COLUMN
=
"org_role_id"
;
public
static
final
Role
EMPTY_ROLE
=
new
Role
(
"----"
);
...
...
@@ -74,6 +76,10 @@ public class Role extends GenericEntity {
@ManyToOne
@JoinColumn
(
name
=
EVENT_ID_COLUMN
,
nullable
=
false
)
private
LanEvent
event
;
@ManyToOne
@JoinColumn
(
name
=
ORG_ROLE_ID_COLUMN
)
private
OrgRole
orgRole
;
public
Role
()
{
super
();
...
...
@@ -190,4 +196,12 @@ public class Role extends GenericEntity {
this
.
users
=
users
;
}
public
OrgRole
getOrgRole
()
{
return
orgRole
;
}
public
void
setOrgRole
(
OrgRole
orgRole
)
{
this
.
orgRole
=
orgRole
;
}
}
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