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 6b44766d
authored
Mar 20, 2010
by
Tuukka Kivilahti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changet database, keep fun
1 parent
982acbb6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
23 deletions
code/LanBortalDatabase/src/fi/insomnia/bortal/model/AccessRight.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/NewsGroup.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Role.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/AccessRight.java
View file @
6b44766
...
...
@@ -45,9 +45,6 @@ public class AccessRight implements ModelInterface {
@Column
(
name
=
"right_description"
)
private
String
description
;
@OneToMany
(
cascade
=
CascadeType
.
ALL
,
mappedBy
=
"accessRight"
)
private
List
<
NewsGroup
>
newsGroups
;
@OneToMany
(
mappedBy
=
"accessRight"
)
private
List
<
RoleRight
>
roleRights
;
...
...
@@ -87,14 +84,6 @@ public class AccessRight implements ModelInterface {
this
.
name
=
accessRight
;
}
public
List
<
NewsGroup
>
getNewsGroupList
()
{
return
newsGroups
;
}
public
void
setNewsGroupList
(
List
<
NewsGroup
>
newsGroupList
)
{
this
.
newsGroups
=
newsGroupList
;
}
public
List
<
RoleRight
>
getRoleRightList
()
{
return
roleRights
;
}
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/NewsGroup.java
View file @
6b44766
...
...
@@ -13,8 +13,9 @@ import javax.persistence.GeneratedValue;
import
javax.persistence.GenerationType
;
import
javax.persistence.Id
;
import
javax.persistence.JoinColumn
;
import
javax.persistence.JoinTable
;
import
javax.persistence.Lob
;
import
javax.persistence.ManyTo
One
;
import
javax.persistence.ManyTo
Many
;
import
javax.persistence.NamedQueries
;
import
javax.persistence.NamedQuery
;
import
javax.persistence.OneToMany
;
...
...
@@ -51,9 +52,9 @@ public class NewsGroup implements ModelInterface {
@Column
(
name
=
"priority"
,
nullable
=
false
)
private
int
priority
;
@
JoinColumn
(
name
=
"access_rights_id"
,
referencedColumnName
=
"access_rights_id"
,
nullable
=
false
)
@
ManyToOne
(
optional
=
false
)
private
AccessRight
accessRight
;
@
ManyToMany
@
JoinTable
(
name
=
"roles_news_groups"
,
joinColumns
=
@JoinColumn
(
name
=
"news_groups_id"
,
referencedColumnName
=
"news_groups_id"
),
inverseJoinColumns
=
@JoinColumn
(
name
=
"roles_id"
,
referencedColumnName
=
"roles_id"
)
)
private
List
<
Role
>
roles
;
@OneToMany
(
cascade
=
CascadeType
.
ALL
,
mappedBy
=
"group"
)
private
List
<
News
>
news
;
...
...
@@ -99,14 +100,6 @@ public class NewsGroup implements ModelInterface {
this
.
priority
=
priority
;
}
public
AccessRight
getAccessRight
()
{
return
accessRight
;
}
public
void
setAccessRight
(
AccessRight
accessRightsId
)
{
this
.
accessRight
=
accessRightsId
;
}
public
List
<
News
>
getNews
()
{
return
news
;
}
...
...
@@ -176,4 +169,18 @@ public class NewsGroup implements ModelInterface {
public
void
setJpaVersionField
(
int
jpaVersionField
)
{
this
.
jpaVersionField
=
jpaVersionField
;
}
/**
* @return the roles
*/
public
List
<
Role
>
getRoles
()
{
return
roles
;
}
/**
* @param roles the roles to set
*/
public
void
setRoles
(
List
<
Role
>
roles
)
{
this
.
roles
=
roles
;
}
}
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Role.java
View file @
6b44766
...
...
@@ -67,10 +67,14 @@ public class Role implements ModelInterface {
@OneToMany
(
cascade
=
CascadeType
.
ALL
,
mappedBy
=
"role"
)
private
List
<
Discount
>
discounts
;
@ManyToMany
(
mappedBy
=
"roles"
)
private
List
<
NewsGroup
>
newsGroups
;
@Version
@Column
(
nullable
=
false
)
private
int
jpaVersionField
;
public
Role
()
{
}
...
...
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