Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Codecrew
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
30
Merge Requests
2
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 79ff9107
authored
May 12, 2012
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Eventuser päivitystä
1 parent
0f381060
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
150 additions
and
7 deletions
code/LanBortalDatabase/src/fi/insomnia/bortal/model/EventUser.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/EventUser.java
View file @
79ff910
package
fi
.
insomnia
.
bortal
.
model
;
package
fi
.
insomnia
.
bortal
.
model
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
javax.persistence.CascadeType
;
import
javax.persistence.CascadeType
;
import
javax.persistence.Entity
;
import
javax.persistence.Entity
;
...
@@ -8,24 +9,166 @@ import javax.persistence.FetchType;
...
@@ -8,24 +9,166 @@ import javax.persistence.FetchType;
import
javax.persistence.JoinColumn
;
import
javax.persistence.JoinColumn
;
import
javax.persistence.JoinTable
;
import
javax.persistence.JoinTable
;
import
javax.persistence.ManyToMany
;
import
javax.persistence.ManyToMany
;
import
javax.persistence.ManyToOne
;
import
javax.persistence.OneToMany
;
import
javax.persistence.OneToMany
;
import
javax.persistence.OrderBy
;
import
javax.persistence.OrderBy
;
import
javax.persistence.Table
;
import
javax.persistence.Table
;
import
javax.persistence.UniqueConstraint
;
import
org.eclipse.persistence.annotations.OptimisticLocking
;
import
org.eclipse.persistence.annotations.OptimisticLocking
;
import
org.eclipse.persistence.annotations.OptimisticLockingType
;
import
org.eclipse.persistence.annotations.OptimisticLockingType
;
@Entity
@Entity
@Table
(
name
=
"event_users"
)
@Table
(
name
=
"event_users"
,
uniqueConstraints
=
@UniqueConstraint
(
columnNames
=
{
EventUser
.
USER_ID_COLUMN
,
EventUser
.
EVENT_ID_COLUMN
})
)
@OptimisticLocking
(
type
=
OptimisticLockingType
.
CHANGED_COLUMNS
)
@OptimisticLocking
(
type
=
OptimisticLockingType
.
CHANGED_COLUMNS
)
public
class
EventUser
extends
GenericEntity
{
public
class
EventUser
extends
GenericEntity
{
// NOTICE!!!!
protected
static
final
String
USER_ID_COLUMN
=
"user_id"
;
// These parameters are event specific and should not be accessed directly!
protected
static
final
String
EVENT_ID_COLUMN
=
"event_id"
;
public
User
getUser
()
{
return
user
;
}
public
void
setUser
(
User
user
)
{
this
.
user
=
user
;
}
public
LanEvent
getEvent
()
{
return
event
;
}
public
void
setEvent
(
LanEvent
event
)
{
this
.
event
=
event
;
}
public
List
<
Vote
>
getVotes
()
{
return
votes
;
}
public
void
setVotes
(
List
<
Vote
>
votes
)
{
this
.
votes
=
votes
;
}
public
List
<
UserNote
>
getNotes
()
{
return
notes
;
}
public
void
setNotes
(
List
<
UserNote
>
notes
)
{
this
.
notes
=
notes
;
}
public
List
<
Role
>
getRoles
()
{
return
roles
;
}
public
void
setRoles
(
List
<
Role
>
roles
)
{
this
.
roles
=
roles
;
}
public
List
<
LogEntry
>
getLogEntryList
()
{
return
logEntryList
;
}
public
void
setLogEntryList
(
List
<
LogEntry
>
logEntryList
)
{
this
.
logEntryList
=
logEntryList
;
}
public
List
<
CompoEntryParticipant
>
getCompoEntryParticipants
()
{
return
compoEntryParticipants
;
}
public
void
setCompoEntryParticipants
(
List
<
CompoEntryParticipant
>
compoEntryParticipants
)
{
this
.
compoEntryParticipants
=
compoEntryParticipants
;
}
public
List
<
CompoEntry
>
getCompoEntries
()
{
return
compoEntries
;
}
public
void
setCompoEntries
(
List
<
CompoEntry
>
compoEntries
)
{
this
.
compoEntries
=
compoEntries
;
}
public
List
<
PlaceGroup
>
getPlaceGroups
()
{
return
placeGroups
;
}
public
void
setPlaceGroups
(
List
<
PlaceGroup
>
placeGroups
)
{
this
.
placeGroups
=
placeGroups
;
}
public
List
<
GroupMembership
>
getGroupMemberships
()
{
return
groupMemberships
;
}
public
void
setGroupMemberships
(
List
<
GroupMembership
>
groupMemberships
)
{
this
.
groupMemberships
=
groupMemberships
;
}
public
List
<
Place
>
getCurrentPlaces
()
{
return
currentPlaces
;
}
public
void
setCurrentPlaces
(
List
<
Place
>
currentPlaces
)
{
this
.
currentPlaces
=
currentPlaces
;
}
public
List
<
PrintedCard
>
getPrintedCards
()
{
return
printedCards
;
}
public
void
setPrintedCards
(
List
<
PrintedCard
>
printedCards
)
{
this
.
printedCards
=
printedCards
;
}
public
List
<
AccountEvent
>
getAccountEvents
()
{
return
accountEvents
;
}
public
void
setAccountEvents
(
List
<
AccountEvent
>
accountEvents
)
{
this
.
accountEvents
=
accountEvents
;
}
public
List
<
Bill
>
getBills
()
{
return
bills
;
}
public
void
setBills
(
List
<
Bill
>
bills
)
{
this
.
bills
=
bills
;
}
public
List
<
AccountEvent
>
getSoldItems
()
{
return
soldItems
;
}
public
void
setSoldItems
(
List
<
AccountEvent
>
soldItems
)
{
this
.
soldItems
=
soldItems
;
}
public
List
<
EventOrganiser
>
getEventOrganiser
()
{
return
eventOrganiser
;
}
public
void
setEventOrganiser
(
List
<
EventOrganiser
>
eventOrganiser
)
{
this
.
eventOrganiser
=
eventOrganiser
;
}
public
List
<
PollAnswer
>
getPollAnswers
()
{
return
pollAnswers
;
}
public
void
setPollAnswers
(
List
<
PollAnswer
>
pollAnswers
)
{
this
.
pollAnswers
=
pollAnswers
;
}
@ManyToOne
@JoinColumn
(
nullable
=
false
,
name
=
USER_ID_COLUMN
)
private
User
user
;
@ManyToOne
@JoinColumn
(
nullable
=
false
,
name
=
EVENT_ID_COLUMN
)
private
LanEvent
event
;
/**
*
*/
private
static
final
long
serialVersionUID
=
6042691271548196815L
;
private
static
final
long
serialVersionUID
=
6042691271548196815L
;
@OneToMany
(
mappedBy
=
"voter"
,
cascade
=
CascadeType
.
ALL
)
@OneToMany
(
mappedBy
=
"voter"
,
cascade
=
CascadeType
.
ALL
)
...
@@ -51,7 +194,7 @@ public class EventUser extends GenericEntity {
...
@@ -51,7 +194,7 @@ public class EventUser extends GenericEntity {
@OrderBy
(
"id"
)
@OrderBy
(
"id"
)
private
List
<
CompoEntry
>
compoEntries
;
private
List
<
CompoEntry
>
compoEntries
;
@OneToMany
(
mappedBy
=
"creator"
,
cascade
=
ALL
)
@OneToMany
(
mappedBy
=
"creator"
,
cascade
=
CascadeType
.
ALL
)
private
List
<
PlaceGroup
>
placeGroups
=
new
ArrayList
<
PlaceGroup
>();
private
List
<
PlaceGroup
>
placeGroups
=
new
ArrayList
<
PlaceGroup
>();
@OneToMany
(
mappedBy
=
"user"
)
@OneToMany
(
mappedBy
=
"user"
)
...
...
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