Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Linnea Samila
/
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 ee7c91cf
authored
Mar 20, 2010
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Siirretty käyttämään EntityPk luokkaa composite keynä
1 parent
c0697f82
Hide whitespace changes
Inline
Side-by-side
Showing
36 changed files
with
255 additions
and
298 deletions
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/SessionHandlerBean.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/AccessRight.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/AccountEvent.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Bill.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/BillLine.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/CardTemplate.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Compo.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/CompoEntry.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/CompoEntryFile.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/CompoEntryParticipant.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Discount.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/DiscountInstance.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Event.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/EventMap.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/EventSettings.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/EventStatus.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/FoodWave.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/FoodWaveTemplate.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/GroupMembership.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Location.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/LogEntry.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/LogEntryType.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/ModelInterface.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/News.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/NewsGroup.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Place.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/PlaceGroup.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/PrintedCard.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Product.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Reader.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/ReaderEvent.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Role.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/RoleRight.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/User.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/UserImage.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Vote.java
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/SessionHandlerBean.java
View file @
ee7c91c
...
...
@@ -43,13 +43,12 @@ public class SessionHandlerBean implements SessionHandlerBeanLocal {
return
false
;
}
private
static
boolean
getRights
(
Role
role
,
String
target
,
RolePermission
permission
,
Set
<
Role
>
checkedRoles
)
{
private
static
boolean
getRights
(
Role
role
,
String
target
,
RolePermission
permission
,
Set
<
Role
>
checkedRoles
)
{
if
(
checkedRoles
.
contains
(
role
))
{
if
(
checkedRoles
.
contains
(
role
))
{
return
false
;
}
for
(
RoleRight
rr
:
role
.
getRoleRights
())
{
if
(
rr
.
getAccessRight
().
getAccessRight
().
equals
(
target
))
{
switch
(
permission
)
{
...
...
@@ -73,13 +72,12 @@ public class SessionHandlerBean implements SessionHandlerBeanLocal {
checkedRoles
.
add
(
role
);
for
(
Role
r
:
role
.
getParents
())
{
if
(
getRights
(
r
,
target
,
permission
,
checkedRoles
))
{
if
(
getRights
(
r
,
target
,
permission
,
checkedRoles
))
{
return
true
;
}
}
return
false
;
}
}
code/LanBortalDatabase/src/fi/insomnia/bortal/model/AccessRight.java
View file @
ee7c91c
...
...
@@ -28,7 +28,7 @@ import javax.persistence.Version;
@NamedQueries
(
{
@NamedQuery
(
name
=
"AccessRight.findAll"
,
query
=
"SELECT a FROM AccessRight a"
),
@NamedQuery
(
name
=
"AccessRight.findByName"
,
query
=
"SELECT a FROM AccessRight a WHERE a.name = :name"
)
})
public
class
AccessRight
implements
ModelInterface
{
public
class
AccessRight
implements
ModelInterface
<
Integer
>
{
private
static
final
long
serialVersionUID
=
1L
;
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/AccountEvent.java
View file @
ee7c91c
...
...
@@ -10,6 +10,7 @@ import java.util.Calendar;
import
java.util.List
;
import
javax.persistence.Column
;
import
javax.persistence.EmbeddedId
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
...
...
@@ -36,13 +37,11 @@ import javax.persistence.Version;
@NamedQuery
(
name
=
"AccountEvent.findByUnits"
,
query
=
"SELECT a FROM AccountEvent a WHERE a.units = :units"
),
@NamedQuery
(
name
=
"AccountEvent.findByEventTime"
,
query
=
"SELECT a FROM AccountEvent a WHERE a.eventTime = :eventTime"
),
@NamedQuery
(
name
=
"AccountEvent.findByDelivered"
,
query
=
"SELECT a FROM AccountEvent a WHERE a.delivered = :delivered"
)
})
public
class
AccountEvent
implements
ModelInterface
{
public
class
AccountEvent
implements
EventChildInterface
{
private
static
final
long
serialVersionUID
=
1L
;
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"account_events_id"
,
nullable
=
false
)
private
Integer
id
;
@EmbeddedId
private
EventPk
id
;
@Column
(
name
=
"unit_price"
,
nullable
=
false
,
precision
=
24
,
scale
=
4
)
private
BigDecimal
unitPrice
;
...
...
@@ -85,12 +84,12 @@ public class AccountEvent implements ModelInterface {
private
int
jpaVersionField
;
@Override
public
Integer
getId
()
{
public
EventPk
getId
()
{
return
id
;
}
@Override
public
void
setId
(
Integer
id
)
{
public
void
setId
(
EventPk
id
)
{
this
.
id
=
id
;
}
...
...
@@ -107,11 +106,11 @@ public class AccountEvent implements ModelInterface {
public
AccountEvent
()
{
}
public
AccountEvent
(
Integer
accountEventsId
)
{
public
AccountEvent
(
EventPk
accountEventsId
)
{
this
.
id
=
accountEventsId
;
}
public
AccountEvent
(
Integer
accountEventsId
,
BigDecimal
unitPrice
,
public
AccountEvent
(
EventPk
accountEventsId
,
BigDecimal
unitPrice
,
BigDecimal
unitCount
,
Calendar
eventTime
)
{
this
.
id
=
accountEventsId
;
this
.
setUnitPrice
(
unitPrice
);
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Bill.java
View file @
ee7c91c
...
...
@@ -8,6 +8,8 @@ import java.util.Calendar;
import
java.util.List
;
import
javax.persistence.Column
;
import
javax.persistence.EmbeddedId
;
import
javax.persistence.EmbeddedId
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
...
...
@@ -38,14 +40,13 @@ import javax.persistence.Version;
@NamedQuery
(
name
=
"Bill.findByPaidDate"
,
query
=
"SELECT b FROM Bill b WHERE b.paidDate = :paidDate"
),
@NamedQuery
(
name
=
"Bill.findByReferenceNumber"
,
query
=
"SELECT b FROM Bill b WHERE b.referenceNumber = :referenceNumber"
),
@NamedQuery
(
name
=
"Bill.findByNotes"
,
query
=
"SELECT b FROM Bill b WHERE b.notes = :notes"
)
})
public
class
Bill
implements
ModelInterface
{
public
class
Bill
implements
EventChildInterface
{
private
static
final
long
serialVersionUID
=
1L
;
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"bills_id"
,
nullable
=
false
)
private
Integer
id
;
@EmbeddedId
private
EventPk
id
;;
@Column
(
name
=
"due_date"
)
@Temporal
(
TemporalType
.
TIMESTAMP
)
...
...
@@ -80,12 +81,12 @@ public class Bill implements ModelInterface {
@Override
public
Integer
getId
()
{
public
EventPk
getId
()
{
return
id
;
}
@Override
public
void
setId
(
Integer
id
)
{
public
void
setId
(
EventPk
id
)
{
this
.
id
=
id
;
}
...
...
@@ -98,7 +99,7 @@ public class Bill implements ModelInterface {
public
Bill
()
{
}
public
Bill
(
Integer
billsId
)
{
public
Bill
(
EventPk
billsId
)
{
this
.
id
=
billsId
;
}
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/BillLine.java
View file @
ee7c91c
...
...
@@ -8,6 +8,7 @@ package fi.insomnia.bortal.model;
import
java.math.BigDecimal
;
import
javax.persistence.Column
;
import
javax.persistence.EmbeddedId
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
...
...
@@ -30,13 +31,11 @@ import javax.persistence.Version;
@NamedQuery
(
name
=
"BillLine.findByUnits"
,
query
=
"SELECT b FROM BillLine b WHERE b.units = :units"
),
@NamedQuery
(
name
=
"BillLine.findByUnitPrice"
,
query
=
"SELECT b FROM BillLine b WHERE b.unitPrice = :unitPrice"
),
@NamedQuery
(
name
=
"BillLine.findByVat"
,
query
=
"SELECT b FROM BillLine b WHERE b.vat = :vat"
)
})
public
class
BillLine
implements
ModelInterface
{
public
class
BillLine
implements
EventChildInterface
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
BigDecimal
DEFAULT_VAT
=
BigDecimal
.
ZERO
;
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"bill_lines_id"
,
nullable
=
false
)
private
Integer
id
;
@EmbeddedId
private
EventPk
id
;
@Column
(
name
=
"name"
,
nullable
=
false
)
private
String
name
;
...
...
@@ -61,11 +60,11 @@ public class BillLine implements ModelInterface {
public
BillLine
()
{
}
public
BillLine
(
Integer
billLinesId
)
{
public
BillLine
(
EventPk
billLinesId
)
{
this
.
id
=
billLinesId
;
}
public
BillLine
(
Integer
billLinesId
,
String
product
,
BigDecimal
units
,
public
BillLine
(
EventPk
billLinesId
,
String
product
,
BigDecimal
units
,
BigDecimal
unitPrice
,
BigDecimal
vat
)
{
this
.
id
=
billLinesId
;
this
.
name
=
product
;
...
...
@@ -128,12 +127,12 @@ public class BillLine implements ModelInterface {
}
@Override
public
Integer
getId
()
{
public
EventPk
getId
()
{
return
id
;
}
@Override
public
void
setId
(
Integer
id
)
{
public
void
setId
(
EventPk
id
)
{
this
.
id
=
id
;
}
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/CardTemplate.java
View file @
ee7c91c
...
...
@@ -8,6 +8,7 @@ package fi.insomnia.bortal.model;
import
java.util.List
;
import
javax.persistence.Column
;
import
javax.persistence.EmbeddedId
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
...
...
@@ -30,12 +31,10 @@ import javax.persistence.Version;
@NamedQuery
(
name
=
"CardTemplate.findAll"
,
query
=
"SELECT c FROM CardTemplate c"
),
@NamedQuery
(
name
=
"CardTemplate.findByName"
,
query
=
"SELECT c FROM CardTemplate c WHERE c.name = :name"
)
})
public
class
CardTemplate
implements
ModelInterface
{
public
class
CardTemplate
implements
EventChildInterface
{
private
static
final
long
serialVersionUID
=
1L
;
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"card_templates_id"
,
nullable
=
false
)
private
Integer
id
;
@EmbeddedId
private
EventPk
id
;
@Lob
@Column
(
name
=
"template_image"
)
...
...
@@ -61,11 +60,11 @@ public class CardTemplate implements ModelInterface {
public
CardTemplate
()
{
}
public
CardTemplate
(
Integer
cardTemplatesId
)
{
public
CardTemplate
(
EventPk
cardTemplatesId
)
{
this
.
id
=
cardTemplatesId
;
}
public
CardTemplate
(
Integer
cardTemplatesId
,
String
templateName
)
{
public
CardTemplate
(
EventPk
cardTemplatesId
,
String
templateName
)
{
this
.
id
=
cardTemplatesId
;
this
.
name
=
templateName
;
}
...
...
@@ -91,12 +90,12 @@ public class CardTemplate implements ModelInterface {
}
@Override
public
Integer
getId
()
{
public
EventPk
getId
()
{
return
id
;
}
@Override
public
void
setId
(
Integer
id
)
{
public
void
setId
(
EventPk
id
)
{
this
.
id
=
id
;
}
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Compo.java
View file @
ee7c91c
...
...
@@ -10,6 +10,7 @@ import java.util.List;
import
javax.persistence.CascadeType
;
import
javax.persistence.Column
;
import
javax.persistence.EmbeddedId
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
...
...
@@ -41,12 +42,10 @@ import javax.persistence.Version;
@NamedQuery
(
name
=
"Compo.findBySubmitEnd"
,
query
=
"SELECT c FROM Compo c WHERE c.submitEnd = :submitEnd"
),
@NamedQuery
(
name
=
"Compo.findByHoldVoting"
,
query
=
"SELECT c FROM Compo c WHERE c.holdVoting = :holdVoting"
),
@NamedQuery
(
name
=
"Compo.findByDescription"
,
query
=
"SELECT c FROM Compo c WHERE c.description = :description"
)
})
public
class
Compo
implements
ModelInterface
{
public
class
Compo
implements
EventChildInterface
{
private
static
final
long
serialVersionUID
=
1L
;
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"compos_id"
,
nullable
=
false
)
private
Integer
id
;
@EmbeddedId
private
EventPk
id
;
@Column
(
name
=
"compo_name"
,
nullable
=
false
)
private
String
name
;
...
...
@@ -94,23 +93,23 @@ public class Compo implements ModelInterface {
private
int
jpaVersionField
;
@Override
public
Integer
getId
()
{
public
EventPk
getId
()
{
return
id
;
}
@Override
public
void
setId
(
Integer
id
)
{
public
void
setId
(
EventPk
id
)
{
this
.
id
=
id
;
}
public
Compo
()
{
}
public
Compo
(
Integer
composId
)
{
public
Compo
(
EventPk
composId
)
{
this
.
id
=
composId
;
}
public
Compo
(
Integer
composId
,
String
compoName
,
boolean
holdVoting
)
{
public
Compo
(
EventPk
composId
,
String
compoName
,
boolean
holdVoting
)
{
this
.
id
=
composId
;
this
.
name
=
compoName
;
this
.
holdVoting
=
holdVoting
;
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/CompoEntry.java
View file @
ee7c91c
...
...
@@ -10,6 +10,7 @@ import java.util.List;
import
javax.persistence.CascadeType
;
import
javax.persistence.Column
;
import
javax.persistence.EmbeddedId
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
...
...
@@ -39,12 +40,10 @@ import javax.persistence.Version;
@NamedQuery
(
name
=
"CompoEntry.findByNotes"
,
query
=
"SELECT c FROM CompoEntry c WHERE c.notes = :notes"
),
@NamedQuery
(
name
=
"CompoEntry.findByScreenMessage"
,
query
=
"SELECT c FROM CompoEntry c WHERE c.screenMessage = :screenMessage"
),
@NamedQuery
(
name
=
"CompoEntry.findBySort"
,
query
=
"SELECT c FROM CompoEntry c WHERE c.sort = :sort"
)
})
public
class
CompoEntry
implements
ModelInterface
{
public
class
CompoEntry
implements
EventChildInterface
{
private
static
final
long
serialVersionUID
=
1L
;
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"entries_id"
,
nullable
=
false
)
private
Integer
id
;
@EmbeddedId
private
EventPk
id
;
@Column
(
name
=
"entry_created"
,
nullable
=
false
)
@Temporal
(
TemporalType
.
TIMESTAMP
)
...
...
@@ -92,23 +91,23 @@ public class CompoEntry implements ModelInterface {
private
int
jpaVersionField
;
@Override
public
Integer
getId
()
{
public
EventPk
getId
()
{
return
id
;
}
@Override
public
void
setId
(
Integer
id
)
{
public
void
setId
(
EventPk
id
)
{
this
.
id
=
id
;
}
public
CompoEntry
()
{
}
public
CompoEntry
(
Integer
entriesId
)
{
public
CompoEntry
(
EventPk
entriesId
)
{
this
.
id
=
entriesId
;
}
public
CompoEntry
(
Integer
entriesId
,
Calendar
entryCreated
,
String
entryName
)
{
public
CompoEntry
(
EventPk
entriesId
,
Calendar
entryCreated
,
String
entryName
)
{
this
.
id
=
entriesId
;
this
.
created
=
entryCreated
;
this
.
name
=
entryName
;
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/CompoEntryFile.java
View file @
ee7c91c
...
...
@@ -8,6 +8,7 @@ package fi.insomnia.bortal.model;
import
java.util.Calendar
;
import
javax.persistence.Column
;
import
javax.persistence.EmbeddedId
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
...
...
@@ -35,12 +36,10 @@ import javax.persistence.Version;
@NamedQuery
(
name
=
"CompoEntryFile.findByDescription"
,
query
=
"SELECT c FROM CompoEntryFile c WHERE c.description = :description"
),
@NamedQuery
(
name
=
"CompoEntryFile.findByHash"
,
query
=
"SELECT c FROM CompoEntryFile c WHERE c.hash = :hash"
),
@NamedQuery
(
name
=
"CompoEntryFile.findByUploaded"
,
query
=
"SELECT c FROM CompoEntryFile c WHERE c.uploaded = :uploaded"
)
})
public
class
CompoEntryFile
implements
ModelInterface
{
public
class
CompoEntryFile
implements
EventChildInterface
{
private
static
final
long
serialVersionUID
=
1L
;
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"entry_files_id"
,
nullable
=
false
)
private
Integer
id
;
@EmbeddedId
private
EventPk
id
;
@Column
(
name
=
"mime_type"
)
private
String
mimeType
;
...
...
@@ -72,23 +71,23 @@ public class CompoEntryFile implements ModelInterface {
private
int
jpaVersionField
;
@Override
public
Integer
getId
()
{
public
EventPk
getId
()
{
return
id
;
}
@Override
public
void
setId
(
Integer
id
)
{
public
void
setId
(
EventPk
id
)
{
this
.
id
=
id
;
}
public
CompoEntryFile
()
{
}
public
CompoEntryFile
(
Integer
entryFilesId
)
{
public
CompoEntryFile
(
EventPk
entryFilesId
)
{
this
.
id
=
entryFilesId
;
}
public
CompoEntryFile
(
Integer
entryFilesId
,
Calendar
uploaded
)
{
public
CompoEntryFile
(
EventPk
entryFilesId
,
Calendar
uploaded
)
{
this
.
id
=
entryFilesId
;
this
.
uploaded
=
uploaded
;
}
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/CompoEntryParticipant.java
View file @
ee7c91c
...
...
@@ -7,6 +7,7 @@ package fi.insomnia.bortal.model;
import
java.util.Calendar
;
import
javax.persistence.Column
;
import
javax.persistence.EmbeddedId
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
...
...
@@ -29,13 +30,11 @@ import javax.persistence.Version;
@NamedQuery
(
name
=
"CompoEntryParticipant.findAll"
,
query
=
"SELECT c FROM CompoEntryParticipant c"
),
@NamedQuery
(
name
=
"CompoEntryParticipant.findByRole"
,
query
=
"SELECT c FROM CompoEntryParticipant c WHERE c.role = :role"
)
})
public
class
CompoEntryParticipant
implements
ModelInterface
{
public
class
CompoEntryParticipant
implements
EventChildInterface
{
private
static
final
long
serialVersionUID
=
1L
;
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"entry_participations_id"
,
nullable
=
false
)
private
Integer
id
;
@EmbeddedId
private
EventPk
id
;
@Column
(
name
=
"role"
)
private
String
role
;
...
...
@@ -61,12 +60,12 @@ public class CompoEntryParticipant implements ModelInterface {
private
int
jpaVersionField
;
@Override
public
Integer
getId
()
{
public
EventPk
getId
()
{
return
id
;
}
@Override
public
void
setId
(
Integer
id
)
{
public
void
setId
(
EventPk
id
)
{
this
.
id
=
id
;
}
...
...
@@ -89,7 +88,7 @@ public class CompoEntryParticipant implements ModelInterface {
public
CompoEntryParticipant
()
{
}
public
CompoEntryParticipant
(
Integer
entryParticipationsId
)
{
public
CompoEntryParticipant
(
EventPk
entryParticipationsId
)
{
this
.
id
=
entryParticipationsId
;
}
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Discount.java
View file @
ee7c91c
...
...
@@ -9,10 +9,8 @@ import java.util.List;
import
javax.persistence.CascadeType
;
import
javax.persistence.Column
;
import
javax.persistence.EmbeddedId
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
import
javax.persistence.Id
;
import
javax.persistence.JoinColumn
;
import
javax.persistence.Lob
;
import
javax.persistence.ManyToOne
;
...
...
@@ -38,12 +36,10 @@ import javax.persistence.Version;
@NamedQuery
(
name
=
"Discount.findByActive"
,
query
=
"SELECT d FROM Discount d WHERE d.active = :active"
),
@NamedQuery
(
name
=
"Discount.findByMaxNum"
,
query
=
"SELECT d FROM Discount d WHERE d.maxNum = :maxNum"
),
@NamedQuery
(
name
=
"Discount.findByPerUser"
,
query
=
"SELECT d FROM Discount d WHERE d.perUser = :perUser"
)
})
public
class
Discount
implements
ModelInterface
{
public
class
Discount
implements
EventChildInterface
{
private
static
final
long
serialVersionUID
=
1L
;
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"discounts_id"
,
nullable
=
false
)
private
Integer
id
;
@EmbeddedId
private
EventPk
id
;
@Column
(
name
=
"percentage"
,
nullable
=
false
,
columnDefinition
=
"integer default 0"
)
private
int
percentage
=
0
;
...
...
@@ -88,21 +84,21 @@ public class Discount implements ModelInterface {
public
Discount
()
{
}
public
Discount
(
Integer
discountsId
)
{
public
Discount
(
EventPk
discountsId
)
{
this
.
id
=
discountsId
;
}
@Override
public
Integer
getId
()
{
public
EventPk
getId
()
{
return
id
;
}
@Override
public
void
setId
(
Integer
id
)
{
public
void
setId
(
EventPk
id
)
{
this
.
id
=
id
;
}
public
Discount
(
Integer
discountsId
,
int
percentage
,
int
amountMin
,
public
Discount
(
EventPk
discountsId
,
int
percentage
,
int
amountMin
,
int
amountMax
,
boolean
active
,
int
maxNum
,
int
perUser
)
{
this
.
id
=
discountsId
;
this
.
setPercentage
(
percentage
);
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/DiscountInstance.java
View file @
ee7c91c
...
...
@@ -7,6 +7,7 @@ package fi.insomnia.bortal.model;
import
java.util.Calendar
;
import
javax.persistence.Column
;
import
javax.persistence.EmbeddedId
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
...
...
@@ -26,13 +27,11 @@ import javax.persistence.Version;
@Entity
@Table
(
name
=
"discount_instances"
)
@NamedQueries
(
{
@NamedQuery
(
name
=
"DiscountInstance.findAll"
,
query
=
"SELECT d FROM DiscountInstance d"
)
})
public
class
DiscountInstance
implements
ModelInterface
{
public
class
DiscountInstance
implements
EventChildInterface
{
private
static
final
long
serialVersionUID
=
1L
;
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"discounts_instances_id"
,
nullable
=
false
)
private
Integer
id
;
@EmbeddedId
private
EventPk
id
;
@Column
(
name
=
"create_time"
,
nullable
=
false
)
@Temporal
(
TemporalType
.
TIMESTAMP
)
...
...
@@ -57,7 +56,7 @@ public class DiscountInstance implements ModelInterface {
public
DiscountInstance
()
{
}
public
DiscountInstance
(
Integer
discountsInstancesId
)
{
public
DiscountInstance
(
EventPk
discountsInstancesId
)
{
this
.
id
=
discountsInstancesId
;
}
...
...
@@ -117,7 +116,7 @@ public class DiscountInstance implements ModelInterface {
* @return the id
*/
@Override
public
Integer
getId
()
{
public
EventPk
getId
()
{
return
id
;
}
...
...
@@ -126,7 +125,7 @@ public class DiscountInstance implements ModelInterface {
* the id to set
*/
@Override
public
void
setId
(
Integer
id
)
{
public
void
setId
(
EventPk
id
)
{
this
.
id
=
id
;
}
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Event.java
View file @
ee7c91c
...
...
@@ -36,7 +36,7 @@ import javax.persistence.Version;
@NamedQuery
(
name
=
"Event.findByEndTime"
,
query
=
"SELECT e FROM Event e WHERE e.endTime = :endTime"
),
@NamedQuery
(
name
=
"Event.findByName"
,
query
=
"SELECT e FROM Event e WHERE e.name = :name"
),
@NamedQuery
(
name
=
"Event.findByReferer"
,
query
=
"SELECT e FROM Event e WHERE e.referer = :referer"
)
})
public
class
Event
implements
ModelInterface
{
public
class
Event
implements
ModelInterface
<
Integer
>
{
private
static
final
long
serialVersionUID
=
1L
;
@Id
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/EventMap.java
View file @
ee7c91c
...
...
@@ -8,6 +8,7 @@ import java.util.List;
import
javax.persistence.CascadeType
;
import
javax.persistence.Column
;
import
javax.persistence.EmbeddedId
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
...
...
@@ -30,13 +31,11 @@ import javax.persistence.Version;
@NamedQuery
(
name
=
"EventMap.findAll"
,
query
=
"SELECT e FROM EventMap e"
),
@NamedQuery
(
name
=
"EventMap.findByName"
,
query
=
"SELECT e FROM EventMap e WHERE e.name = :name"
)
})
public
class
EventMap
implements
ModelInterface
{
public
class
EventMap
implements
EventChildInterface
{
private
static
final
long
serialVersionUID
=
1L
;
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"maps_id"
,
nullable
=
false
)
private
Integer
id
;
@EmbeddedId
private
EventPk
id
;
@Lob
@Column
(
name
=
"map_data"
)
...
...
@@ -61,7 +60,7 @@ public class EventMap implements ModelInterface {
public
EventMap
()
{
}
public
EventMap
(
Integer
mapsId
)
{
public
EventMap
(
EventPk
mapsId
)
{
this
.
id
=
mapsId
;
}
...
...
@@ -128,7 +127,7 @@ public class EventMap implements ModelInterface {
* @return the id
*/
@Override
public
Integer
getId
()
{
public
EventPk
getId
()
{
return
id
;
}
...
...
@@ -137,7 +136,7 @@ public class EventMap implements ModelInterface {
* the id to set
*/
@Override
public
void
setId
(
Integer
id
)
{
public
void
setId
(
EventPk
id
)
{
this
.
id
=
id
;
}
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/EventSettings.java
View file @
ee7c91c
...
...
@@ -8,6 +8,7 @@ import java.util.List;
import
javax.persistence.CascadeType
;
import
javax.persistence.Column
;
import
javax.persistence.EmbeddedId
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
...
...
@@ -30,13 +31,11 @@ import javax.persistence.Version;
@NamedQuery
(
name
=
"EventSettings.findByBaseName"
,
query
=
"SELECT e FROM EventSettings e WHERE e.baseName = :baseName"
),
@NamedQuery
(
name
=
"EventSettings.findByStyleSheet"
,
query
=
"SELECT e FROM EventSettings e WHERE e.styleSheet = :styleSheet"
)
})
public
class
EventSettings
implements
ModelInterface
{
public
class
EventSettings
implements
EventChildInterface
{
private
static
final
long
serialVersionUID
=
1L
;
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"event_settings_id"
,
nullable
=
false
)
private
Integer
id
;
@EmbeddedId
private
EventPk
id
;
@Column
(
name
=
"organisation"
)
private
String
organisation
;
...
...
@@ -59,7 +58,7 @@ public class EventSettings implements ModelInterface {
public
EventSettings
()
{
}
public
EventSettings
(
Integer
eventSettingsId
)
{
public
EventSettings
(
EventPk
eventSettingsId
)
{
this
.
id
=
eventSettingsId
;
}
...
...
@@ -102,7 +101,7 @@ public class EventSettings implements ModelInterface {
* @return the id
*/
@Override
public
Integer
getId
()
{
public
EventPk
getId
()
{
return
id
;
}
...
...
@@ -111,7 +110,7 @@ public class EventSettings implements ModelInterface {
* the id to set
*/
@Override
public
void
setId
(
Integer
id
)
{
public
void
setId
(
EventPk
id
)
{
this
.
id
=
id
;
}
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/EventStatus.java
View file @
ee7c91c
...
...
@@ -8,6 +8,7 @@ import java.util.List;
import
javax.persistence.CascadeType
;
import
javax.persistence.Column
;
import
javax.persistence.EmbeddedId
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
...
...
@@ -28,14 +29,12 @@ import javax.persistence.Version;
@NamedQuery
(
name
=
"EventStatus.findAll"
,
query
=
"SELECT e FROM EventStatus e"
),
@NamedQuery
(
name
=
"EventStatus.findByStatusName"
,
query
=
"SELECT e FROM EventStatus e WHERE e.statusName = :statusName"
)
})
public
class
EventStatus
implements
ModelInterface
{
public
class
EventStatus
implements
EventChildInterface
{
private
static
final
long
serialVersionUID
=
1L
;
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"event_status_id"
,
nullable
=
false
)
private
Integer
id
;
@EmbeddedId
private
EventPk
id
;
@Column
(
name
=
"status_name"
,
nullable
=
false
)
private
String
statusName
;
...
...
@@ -50,11 +49,11 @@ public class EventStatus implements ModelInterface {
public
EventStatus
()
{
}
public
EventStatus
(
Integer
eventStatusId
)
{
public
EventStatus
(
EventPk
eventStatusId
)
{
this
.
id
=
eventStatusId
;
}
public
EventStatus
(
Integer
eventStatusId
,
String
statusName
)
{
public
EventStatus
(
EventPk
eventStatusId
,
String
statusName
)
{
this
.
id
=
eventStatusId
;
this
.
statusName
=
statusName
;
}
...
...
@@ -106,7 +105,7 @@ public class EventStatus implements ModelInterface {
* @return the id
*/
@Override
public
Integer
getId
()
{
public
EventPk
getId
()
{
return
id
;
}
...
...
@@ -115,7 +114,7 @@ public class EventStatus implements ModelInterface {
* the id to set
*/
@Override
public
void
setId
(
Integer
id
)
{
public
void
setId
(
EventPk
id
)
{
this
.
id
=
id
;
}
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/FoodWave.java
View file @
ee7c91c
...
...
@@ -8,6 +8,7 @@ import java.util.Calendar;
import
java.util.List
;
import
javax.persistence.Column
;
import
javax.persistence.EmbeddedId
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
...
...
@@ -33,13 +34,11 @@ import javax.persistence.Version;
@NamedQuery
(
name
=
"FoodWave.findByDescription"
,
query
=
"SELECT f FROM FoodWave f WHERE f.description = :description"
),
@NamedQuery
(
name
=
"FoodWave.findByTime"
,
query
=
"SELECT f FROM FoodWave f WHERE f.time = :time"
),
@NamedQuery
(
name
=
"FoodWave.findByClosed"
,
query
=
"SELECT f FROM FoodWave f WHERE f.closed = :closed"
)
})
public
class
FoodWave
implements
ModelInterface
{
public
class
FoodWave
implements
EventChildInterface
{
private
static
final
long
serialVersionUID
=
1L
;
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"food_waves_id"
,
nullable
=
false
)
private
Integer
id
;
@EmbeddedId
private
EventPk
id
;
@Column
(
name
=
"wave_name"
,
nullable
=
false
)
private
String
name
;
...
...
@@ -65,11 +64,11 @@ public class FoodWave implements ModelInterface {
public
FoodWave
()
{
}
public
FoodWave
(
Integer
foodWavesId
)
{
public
FoodWave
(
EventPk
foodWavesId
)
{
this
.
id
=
foodWavesId
;
}
public
FoodWave
(
Integer
foodWavesId
,
String
waveName
,
boolean
waveClosed
)
{
public
FoodWave
(
EventPk
foodWavesId
,
String
waveName
,
boolean
waveClosed
)
{
this
.
id
=
foodWavesId
;
this
.
name
=
waveName
;
this
.
closed
=
waveClosed
;
...
...
@@ -147,7 +146,7 @@ public class FoodWave implements ModelInterface {
* @return the id
*/
@Override
public
Integer
getId
()
{
public
EventPk
getId
()
{
return
id
;
}
...
...
@@ -156,7 +155,7 @@ public class FoodWave implements ModelInterface {
* the id to set
*/
@Override
public
void
setId
(
Integer
id
)
{
public
void
setId
(
EventPk
id
)
{
this
.
id
=
id
;
}
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/FoodWaveTemplate.java
View file @
ee7c91c
...
...
@@ -7,6 +7,7 @@ package fi.insomnia.bortal.model;
import
java.util.List
;
import
javax.persistence.Column
;
import
javax.persistence.EmbeddedId
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
...
...
@@ -28,13 +29,11 @@ import javax.persistence.Version;
@NamedQuery
(
name
=
"FoodWaveTemplate.findByName"
,
query
=
"SELECT f FROM FoodWaveTemplate f WHERE f.name = :name"
),
@NamedQuery
(
name
=
"FoodWaveTemplate.findByDescription"
,
query
=
"SELECT f FROM FoodWaveTemplate f WHERE f.description = :description"
)
})
public
class
FoodWaveTemplate
implements
ModelInterface
{
public
class
FoodWaveTemplate
implements
EventChildInterface
{
private
static
final
long
serialVersionUID
=
1L
;
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"food_wave_templates_id"
,
nullable
=
false
)
private
Integer
id
;
@EmbeddedId
private
EventPk
id
;
@Column
(
name
=
"template_name"
,
nullable
=
false
)
private
String
name
;
...
...
@@ -53,11 +52,11 @@ public class FoodWaveTemplate implements ModelInterface {
public
FoodWaveTemplate
()
{
}
public
FoodWaveTemplate
(
Integer
foodWaveTemplatesId
)
{
public
FoodWaveTemplate
(
EventPk
foodWaveTemplatesId
)
{
this
.
id
=
foodWaveTemplatesId
;
}
public
FoodWaveTemplate
(
Integer
foodWaveTemplatesId
,
String
templateName
)
{
public
FoodWaveTemplate
(
EventPk
foodWaveTemplatesId
,
String
templateName
)
{
this
.
id
=
foodWaveTemplatesId
;
this
.
name
=
templateName
;
}
...
...
@@ -124,7 +123,7 @@ public class FoodWaveTemplate implements ModelInterface {
* @return the id
*/
@Override
public
Integer
getId
()
{
public
EventPk
getId
()
{
return
id
;
}
...
...
@@ -133,7 +132,7 @@ public class FoodWaveTemplate implements ModelInterface {
* the id to set
*/
@Override
public
void
setId
(
Integer
id
)
{
public
void
setId
(
EventPk
id
)
{
this
.
id
=
id
;
}
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/GroupMembership.java
View file @
ee7c91c
...
...
@@ -7,6 +7,7 @@ package fi.insomnia.bortal.model;
import
java.util.Calendar
;
import
javax.persistence.Column
;
import
javax.persistence.EmbeddedId
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
...
...
@@ -34,13 +35,11 @@ import javax.persistence.Version;
@NamedQuery
(
name
=
"GroupMembership.findByInviteAccepted"
,
query
=
"SELECT g FROM GroupMembership g WHERE g.inviteAccepted = :inviteAccepted"
),
@NamedQuery
(
name
=
"GroupMembership.findByInviteEmail"
,
query
=
"SELECT g FROM GroupMembership g WHERE g.inviteEmail = :inviteEmail"
),
@NamedQuery
(
name
=
"GroupMembership.findByInviteName"
,
query
=
"SELECT g FROM GroupMembership g WHERE g.inviteName = :inviteName"
)
})
public
class
GroupMembership
implements
ModelInterface
{
public
class
GroupMembership
implements
EventChildInterface
{
private
static
final
long
serialVersionUID
=
1L
;
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"group_memberships_id"
,
nullable
=
false
)
private
Integer
id
;
@EmbeddedId
private
EventPk
id
;
@Column
(
name
=
"invite_accepted"
)
@Temporal
(
TemporalType
.
TIMESTAMP
)
...
...
@@ -77,7 +76,7 @@ public class GroupMembership implements ModelInterface {
public
GroupMembership
()
{
}
public
GroupMembership
(
Integer
groupMembershipsId
)
{
public
GroupMembership
(
EventPk
groupMembershipsId
)
{
this
.
id
=
groupMembershipsId
;
}
...
...
@@ -160,7 +159,7 @@ public class GroupMembership implements ModelInterface {
* @return the id
*/
@Override
public
Integer
getId
()
{
public
EventPk
getId
()
{
return
id
;
}
...
...
@@ -169,7 +168,7 @@ public class GroupMembership implements ModelInterface {
* the id to set
*/
@Override
public
void
setId
(
Integer
id
)
{
public
void
setId
(
EventPk
id
)
{
this
.
id
=
id
;
}
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Location.java
View file @
ee7c91c
...
...
@@ -7,6 +7,7 @@ package fi.insomnia.bortal.model;
import
java.util.List
;
import
javax.persistence.Column
;
import
javax.persistence.EmbeddedId
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
...
...
@@ -26,13 +27,11 @@ import javax.persistence.Version;
@NamedQuery
(
name
=
"Location.findAll"
,
query
=
"SELECT l FROM Location l"
),
@NamedQuery
(
name
=
"Location.findByLocationName"
,
query
=
"SELECT l FROM Location l WHERE l.name = :name"
)
})
public
class
Location
implements
ModelInterface
{
public
class
Location
implements
EventChildInterface
{
private
static
final
long
serialVersionUID
=
1L
;
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"locations_id"
,
nullable
=
false
)
private
Integer
id
;
@EmbeddedId
private
EventPk
id
;
@Column
(
name
=
"location_name"
,
nullable
=
false
)
private
String
name
;
...
...
@@ -50,11 +49,11 @@ public class Location implements ModelInterface {
public
Location
()
{
}
public
Location
(
Integer
locationsId
)
{
public
Location
(
EventPk
locationsId
)
{
this
.
id
=
locationsId
;
}
public
Location
(
Integer
locationsId
,
String
locationName
)
{
public
Location
(
EventPk
locationsId
,
String
locationName
)
{
this
.
id
=
locationsId
;
this
.
name
=
locationName
;
}
...
...
@@ -114,7 +113,7 @@ public class Location implements ModelInterface {
* @return the id
*/
@Override
public
Integer
getId
()
{
public
EventPk
getId
()
{
return
id
;
}
...
...
@@ -123,7 +122,7 @@ public class Location implements ModelInterface {
* the id to set
*/
@Override
public
void
setId
(
Integer
id
)
{
public
void
setId
(
EventPk
id
)
{
this
.
id
=
id
;
}
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/LogEntry.java
View file @
ee7c91c
...
...
@@ -9,6 +9,7 @@ import static javax.persistence.TemporalType.TIMESTAMP;
import
java.util.Calendar
;
import
javax.persistence.Column
;
import
javax.persistence.EmbeddedId
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
...
...
@@ -31,14 +32,12 @@ import javax.persistence.Version;
@NamedQuery
(
name
=
"LogEntry.findAll"
,
query
=
"SELECT l FROM LogEntry l"
),
@NamedQuery
(
name
=
"LogEntry.findByTime"
,
query
=
"SELECT l FROM LogEntry l WHERE l.time = :time"
),
@NamedQuery
(
name
=
"LogEntry.findByDescription"
,
query
=
"SELECT l FROM LogEntry l WHERE l.description = :description"
)
})
public
class
LogEntry
implements
ModelInterface
{
public
class
LogEntry
implements
EventChildInterface
{
private
static
final
long
serialVersionUID
=
1L
;
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"event_log_id"
,
nullable
=
false
)
private
Integer
id
;
@EmbeddedId
private
EventPk
id
;
@Column
(
name
=
"event_time"
,
nullable
=
false
)
@Temporal
(
TIMESTAMP
)
...
...
@@ -63,11 +62,11 @@ public class LogEntry implements ModelInterface {
public
LogEntry
()
{
}
public
LogEntry
(
Integer
eventLogId
)
{
public
LogEntry
(
EventPk
eventLogId
)
{
this
.
id
=
eventLogId
;
}
public
LogEntry
(
Integer
eventLogId
,
Calendar
eventTime
)
{
public
LogEntry
(
EventPk
eventLogId
,
Calendar
eventTime
)
{
this
.
id
=
eventLogId
;
this
.
time
=
eventTime
;
}
...
...
@@ -135,7 +134,7 @@ public class LogEntry implements ModelInterface {
* @return the id
*/
@Override
public
Integer
getId
()
{
public
EventPk
getId
()
{
return
id
;
}
...
...
@@ -144,7 +143,7 @@ public class LogEntry implements ModelInterface {
* the id to set
*/
@Override
public
void
setId
(
Integer
id
)
{
public
void
setId
(
EventPk
id
)
{
this
.
id
=
id
;
}
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/LogEntryType.java
View file @
ee7c91c
...
...
@@ -8,6 +8,7 @@ import java.util.List;
import
javax.persistence.CascadeType
;
import
javax.persistence.Column
;
import
javax.persistence.EmbeddedId
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
...
...
@@ -28,14 +29,12 @@ import javax.persistence.Version;
@NamedQuery
(
name
=
"LogEntryType.findAll"
,
query
=
"SELECT l FROM LogEntryType l"
),
@NamedQuery
(
name
=
"LogEntryType.findByDescription"
,
query
=
"SELECT l FROM LogEntryType l WHERE l.description = :description"
)
})
public
class
LogEntryType
implements
ModelInterface
{
public
class
LogEntryType
implements
EventChildInterface
{
private
static
final
long
serialVersionUID
=
1L
;
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"event_log_types_id"
,
nullable
=
false
)
private
Integer
id
;
@EmbeddedId
private
EventPk
id
;
@Lob
@Column
(
name
=
"event_type_description"
,
nullable
=
false
)
...
...
@@ -51,11 +50,11 @@ public class LogEntryType implements ModelInterface {
public
LogEntryType
()
{
}
public
LogEntryType
(
Integer
eventLogTypesId
)
{
public
LogEntryType
(
EventPk
eventLogTypesId
)
{
this
.
id
=
eventLogTypesId
;
}
public
LogEntryType
(
Integer
eventLogTypesId
,
String
eventTypeDescription
)
{
public
LogEntryType
(
EventPk
eventLogTypesId
,
String
eventTypeDescription
)
{
this
.
id
=
eventLogTypesId
;
this
.
description
=
eventTypeDescription
;
}
...
...
@@ -107,7 +106,7 @@ public class LogEntryType implements ModelInterface {
* @return the id
*/
@Override
public
Integer
getId
()
{
public
EventPk
getId
()
{
return
id
;
}
...
...
@@ -116,7 +115,7 @@ public class LogEntryType implements ModelInterface {
* the id to set
*/
@Override
public
void
setId
(
Integer
id
)
{
public
void
setId
(
EventPk
id
)
{
this
.
id
=
id
;
}
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/ModelInterface.java
View file @
ee7c91c
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package
fi
.
insomnia
.
bortal
.
model
;
import
java.io.Serializable
;
/**
*
* @author tuukka
*/
public
interface
ModelInterface
extends
Serializable
{
public
Integer
getId
();
public
interface
ModelInterface
<
T
>
{
public
T
getId
();
public
void
setId
(
Integer
id
);
public
void
setId
(
T
id
);
public
int
getJpaVersionField
();
public
void
setJpaVersionField
(
int
jpaVersionField
);
}
code/LanBortalDatabase/src/fi/insomnia/bortal/model/News.java
View file @
ee7c91c
...
...
@@ -7,6 +7,7 @@ package fi.insomnia.bortal.model;
import
java.util.Calendar
;
import
javax.persistence.Column
;
import
javax.persistence.EmbeddedId
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
...
...
@@ -36,13 +37,11 @@ import javax.persistence.Version;
@NamedQuery
(
name
=
"News.findByPublish"
,
query
=
"SELECT n FROM News n WHERE n.publish = :publish"
),
@NamedQuery
(
name
=
"News.findByExpire"
,
query
=
"SELECT n FROM News n WHERE n.expire = :expire"
),
@NamedQuery
(
name
=
"News.findByPriority"
,
query
=
"SELECT n FROM News n WHERE n.priority = :priority"
)
})
public
class
News
implements
ModelInterface
{
public
class
News
implements
EventChildInterface
{
private
static
final
long
serialVersionUID
=
1L
;
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"news_id"
,
nullable
=
false
)
private
Integer
id
;
@EmbeddedId
private
EventPk
id
;
@Column
(
name
=
"title"
,
nullable
=
false
)
private
String
title
;
...
...
@@ -77,11 +76,11 @@ public class News implements ModelInterface {
public
News
()
{
}
public
News
(
Integer
newsId
)
{
public
News
(
EventPk
newsId
)
{
this
.
id
=
newsId
;
}
public
News
(
Integer
newsId
,
String
title
,
int
priority
)
{
public
News
(
EventPk
newsId
,
String
title
,
int
priority
)
{
this
.
id
=
newsId
;
this
.
title
=
title
;
this
.
priority
=
priority
;
...
...
@@ -174,7 +173,7 @@ public class News implements ModelInterface {
* @return the id
*/
@Override
public
Integer
getId
()
{
public
EventPk
getId
()
{
return
id
;
}
...
...
@@ -183,7 +182,7 @@ public class News implements ModelInterface {
* the id to set
*/
@Override
public
void
setId
(
Integer
id
)
{
public
void
setId
(
EventPk
id
)
{
this
.
id
=
id
;
}
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/NewsGroup.java
View file @
ee7c91c
...
...
@@ -8,6 +8,7 @@ import java.util.List;
import
javax.persistence.CascadeType
;
import
javax.persistence.Column
;
import
javax.persistence.EmbeddedId
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
...
...
@@ -33,14 +34,12 @@ import javax.persistence.Version;
@NamedQuery
(
name
=
"NewsGroup.findByName"
,
query
=
"SELECT n FROM NewsGroup n WHERE n.name = :name"
),
@NamedQuery
(
name
=
"NewsGroup.findByDescription"
,
query
=
"SELECT n FROM NewsGroup n WHERE n.description = :description"
),
@NamedQuery
(
name
=
"NewsGroup.findByPriority"
,
query
=
"SELECT n FROM NewsGroup n WHERE n.priority = :priority"
)
})
public
class
NewsGroup
implements
ModelInterface
{
public
class
NewsGroup
implements
EventChildInterface
{
private
static
final
long
serialVersionUID
=
1L
;
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"news_groups_id"
,
nullable
=
false
)
private
Integer
id
;
@EmbeddedId
private
EventPk
id
;
@Column
(
name
=
"group_name"
,
nullable
=
false
)
private
String
name
;
...
...
@@ -66,11 +65,11 @@ public class NewsGroup implements ModelInterface {
public
NewsGroup
()
{
}
public
NewsGroup
(
Integer
newsGroupsId
)
{
public
NewsGroup
(
EventPk
newsGroupsId
)
{
this
.
id
=
newsGroupsId
;
}
public
NewsGroup
(
Integer
newsGroupsId
,
String
groupName
,
int
priority
)
{
public
NewsGroup
(
EventPk
newsGroupsId
,
String
groupName
,
int
priority
)
{
this
.
id
=
newsGroupsId
;
this
.
name
=
groupName
;
this
.
priority
=
priority
;
...
...
@@ -140,7 +139,7 @@ public class NewsGroup implements ModelInterface {
* @return the id
*/
@Override
public
Integer
getId
()
{
public
EventPk
getId
()
{
return
id
;
}
...
...
@@ -149,7 +148,7 @@ public class NewsGroup implements ModelInterface {
* the id to set
*/
@Override
public
void
setId
(
Integer
id
)
{
public
void
setId
(
EventPk
id
)
{
this
.
id
=
id
;
}
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Place.java
View file @
ee7c91c
...
...
@@ -5,6 +5,7 @@
package
fi
.
insomnia
.
bortal
.
model
;
import
javax.persistence.Column
;
import
javax.persistence.EmbeddedId
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
...
...
@@ -32,13 +33,11 @@ import javax.persistence.Version;
@NamedQuery
(
name
=
"Place.findByMapY"
,
query
=
"SELECT p FROM Place p WHERE p.mapY = :mapY"
),
@NamedQuery
(
name
=
"Place.findByDetails"
,
query
=
"SELECT p FROM Place p WHERE p.details = :details"
),
@NamedQuery
(
name
=
"Place.findByCode"
,
query
=
"SELECT p FROM Place p WHERE p.code = :code"
)
})
public
class
Place
implements
ModelInterface
{
public
class
Place
implements
EventChildInterface
{
private
static
final
long
serialVersionUID
=
1L
;
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"places_id"
,
nullable
=
false
)
private
Integer
id
;
@EmbeddedId
private
EventPk
id
;
@Lob
@Column
(
name
=
"place_description"
)
private
String
description
;
...
...
@@ -90,7 +89,7 @@ public class Place implements ModelInterface {
public
Place
()
{
}
public
Place
(
Integer
placesId
)
{
public
Place
(
EventPk
placesId
)
{
this
.
id
=
placesId
;
}
...
...
@@ -205,7 +204,7 @@ public class Place implements ModelInterface {
* @return the id
*/
@Override
public
Integer
getId
()
{
public
EventPk
getId
()
{
return
id
;
}
...
...
@@ -214,7 +213,7 @@ public class Place implements ModelInterface {
* the id to set
*/
@Override
public
void
setId
(
Integer
id
)
{
public
void
setId
(
EventPk
id
)
{
this
.
id
=
id
;
}
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/PlaceGroup.java
View file @
ee7c91c
...
...
@@ -9,6 +9,7 @@ import java.util.List;
import
javax.persistence.CascadeType
;
import
javax.persistence.Column
;
import
javax.persistence.EmbeddedId
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
...
...
@@ -38,13 +39,11 @@ import javax.persistence.Version;
@NamedQuery
(
name
=
"PlaceGroup.findByName"
,
query
=
"SELECT p FROM PlaceGroup p WHERE p.name = :name"
),
@NamedQuery
(
name
=
"PlaceGroup.findByActive"
,
query
=
"SELECT p FROM PlaceGroup p WHERE p.active = :active"
),
@NamedQuery
(
name
=
"PlaceGroup.findByDetails"
,
query
=
"SELECT p FROM PlaceGroup p WHERE p.details = :details"
)
})
public
class
PlaceGroup
implements
ModelInterface
{
public
class
PlaceGroup
implements
EventChildInterface
{
private
static
final
long
serialVersionUID
=
1L
;
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"groups_id"
,
nullable
=
false
)
private
Integer
id
;
@EmbeddedId
private
EventPk
id
;
@Column
(
name
=
"group_created"
,
nullable
=
false
)
@Temporal
(
TemporalType
.
TIMESTAMP
)
...
...
@@ -84,11 +83,11 @@ public class PlaceGroup implements ModelInterface {
public
PlaceGroup
()
{
}
public
PlaceGroup
(
Integer
groupsId
)
{
public
PlaceGroup
(
EventPk
groupsId
)
{
this
.
id
=
groupsId
;
}
public
PlaceGroup
(
Integer
groupsId
,
Calendar
groupCreated
,
Calendar
groupEdited
,
public
PlaceGroup
(
EventPk
groupsId
,
Calendar
groupCreated
,
Calendar
groupEdited
,
boolean
groupActive
)
{
this
.
id
=
groupsId
;
this
.
created
=
groupCreated
;
...
...
@@ -199,7 +198,7 @@ public class PlaceGroup implements ModelInterface {
* @return the id
*/
@Override
public
Integer
getId
()
{
public
EventPk
getId
()
{
return
id
;
}
...
...
@@ -208,7 +207,7 @@ public class PlaceGroup implements ModelInterface {
* the id to set
*/
@Override
public
void
setId
(
Integer
id
)
{
public
void
setId
(
EventPk
id
)
{
this
.
id
=
id
;
}
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/PrintedCard.java
View file @
ee7c91c
...
...
@@ -10,6 +10,7 @@ import java.util.List;
import
javax.persistence.CascadeType
;
import
javax.persistence.Column
;
import
javax.persistence.EmbeddedId
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
...
...
@@ -36,12 +37,10 @@ import javax.persistence.Version;
@NamedQuery
(
name
=
"PrintedCard.findByBarcode"
,
query
=
"SELECT p FROM PrintedCard p WHERE p.barcode = :barcode"
),
@NamedQuery
(
name
=
"PrintedCard.findByEnabled"
,
query
=
"SELECT p FROM PrintedCard p WHERE p.enabled = :enabled"
),
@NamedQuery
(
name
=
"PrintedCard.findByRfidUid"
,
query
=
"SELECT p FROM PrintedCard p WHERE p.rfidUid = :rfidUid"
)
})
public
class
PrintedCard
implements
ModelInterface
{
public
class
PrintedCard
implements
EventChildInterface
{
private
static
final
long
serialVersionUID
=
1L
;
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"printed_cards_id"
,
nullable
=
false
)
private
Integer
id
;
@EmbeddedId
private
EventPk
id
;
@Column
(
name
=
"print_time"
,
nullable
=
false
)
@Temporal
(
TemporalType
.
TIMESTAMP
)
...
...
@@ -79,20 +78,20 @@ public class PrintedCard implements ModelInterface {
}
@Override
public
Integer
getId
()
{
public
EventPk
getId
()
{
return
id
;
}
@Override
public
void
setId
(
Integer
id
)
{
public
void
setId
(
EventPk
id
)
{
this
.
id
=
id
;
}
public
PrintedCard
(
Integer
printedCardsId
)
{
public
PrintedCard
(
EventPk
printedCardsId
)
{
this
.
id
=
printedCardsId
;
}
public
PrintedCard
(
Integer
printedCardsId
,
Calendar
printTime
,
public
PrintedCard
(
EventPk
printedCardsId
,
Calendar
printTime
,
boolean
cardEnabled
)
{
this
.
id
=
printedCardsId
;
this
.
printTime
=
printTime
;
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Product.java
View file @
ee7c91c
...
...
@@ -9,6 +9,7 @@ import java.util.List;
import
javax.persistence.CascadeType
;
import
javax.persistence.Column
;
import
javax.persistence.EmbeddedId
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
...
...
@@ -34,14 +35,12 @@ import javax.persistence.Version;
@NamedQuery
(
name
=
"Product.findByPrice"
,
query
=
"SELECT p FROM Product p WHERE p.price = :price"
),
@NamedQuery
(
name
=
"Product.findBySort"
,
query
=
"SELECT p FROM Product p WHERE p.sort = :sort"
),
@NamedQuery
(
name
=
"Product.findByBarcode"
,
query
=
"SELECT p FROM Product p WHERE p.barcode = :barcode"
)
})
public
class
Product
implements
ModelInterface
{
public
class
Product
implements
EventChildInterface
{
private
static
final
long
serialVersionUID
=
1L
;
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"products_id"
,
nullable
=
false
)
private
Integer
id
;
@EmbeddedId
private
EventPk
id
;
@Column
(
name
=
"product_name"
)
private
String
name
;
...
...
@@ -75,11 +74,11 @@ public class Product implements ModelInterface {
public
Product
()
{
}
public
Product
(
Integer
productsId
)
{
public
Product
(
EventPk
productsId
)
{
this
.
id
=
productsId
;
}
public
Product
(
Integer
productsId
,
BigInteger
price
,
int
sort
)
{
public
Product
(
EventPk
productsId
,
BigInteger
price
,
int
sort
)
{
this
.
id
=
productsId
;
this
.
price
=
price
;
this
.
sort
=
sort
;
...
...
@@ -179,7 +178,7 @@ public class Product implements ModelInterface {
* @return the id
*/
@Override
public
Integer
getId
()
{
public
EventPk
getId
()
{
return
id
;
}
...
...
@@ -188,7 +187,7 @@ public class Product implements ModelInterface {
* the id to set
*/
@Override
public
void
setId
(
Integer
id
)
{
public
void
setId
(
EventPk
id
)
{
this
.
id
=
id
;
}
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Reader.java
View file @
ee7c91c
...
...
@@ -8,6 +8,7 @@ import java.util.List;
import
javax.persistence.CascadeType
;
import
javax.persistence.Column
;
import
javax.persistence.EmbeddedId
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
...
...
@@ -31,14 +32,12 @@ import javax.persistence.Version;
@NamedQuery
(
name
=
"Reader.findByIdentification"
,
query
=
"SELECT r FROM Reader r WHERE r.identification = :identification"
),
@NamedQuery
(
name
=
"Reader.findByDescription"
,
query
=
"SELECT r FROM Reader r WHERE r.description = :description"
)
})
public
class
Reader
implements
ModelInterface
{
public
class
Reader
implements
EventChildInterface
{
private
static
final
long
serialVersionUID
=
1L
;
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"readers_id"
,
nullable
=
false
)
private
Integer
id
;
@EmbeddedId
private
EventPk
id
;
@Column
(
name
=
"reader_ident"
)
private
String
identification
;
...
...
@@ -76,7 +75,7 @@ public class Reader implements ModelInterface {
public
Reader
()
{
}
public
Reader
(
Integer
readersId
)
{
public
Reader
(
EventPk
readersId
)
{
this
.
id
=
readersId
;
}
...
...
@@ -143,7 +142,7 @@ public class Reader implements ModelInterface {
* @return the id
*/
@Override
public
Integer
getId
()
{
public
EventPk
getId
()
{
return
id
;
}
...
...
@@ -152,7 +151,7 @@ public class Reader implements ModelInterface {
* the id to set
*/
@Override
public
void
setId
(
Integer
id
)
{
public
void
setId
(
EventPk
id
)
{
this
.
id
=
id
;
}
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/ReaderEvent.java
View file @
ee7c91c
...
...
@@ -7,6 +7,7 @@ package fi.insomnia.bortal.model;
import
java.util.Calendar
;
import
javax.persistence.Column
;
import
javax.persistence.EmbeddedId
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
...
...
@@ -30,14 +31,12 @@ import javax.persistence.Version;
@NamedQuery
(
name
=
"ReaderEvent.findByTime"
,
query
=
"SELECT r FROM ReaderEvent r WHERE r.time = :time"
),
@NamedQuery
(
name
=
"ReaderEvent.findByValue"
,
query
=
"SELECT r FROM ReaderEvent r WHERE r.value = :value"
)
})
public
class
ReaderEvent
implements
ModelInterface
{
public
class
ReaderEvent
implements
EventChildInterface
{
private
static
final
long
serialVersionUID
=
1L
;
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"reader_events_id"
,
nullable
=
false
)
private
Integer
id
;
@EmbeddedId
private
EventPk
id
;
@Column
(
name
=
"event_time"
,
nullable
=
false
)
@Temporal
(
TemporalType
.
TIMESTAMP
)
...
...
@@ -61,11 +60,11 @@ public class ReaderEvent implements ModelInterface {
public
ReaderEvent
()
{
}
public
ReaderEvent
(
Integer
readerEventsId
)
{
public
ReaderEvent
(
EventPk
readerEventsId
)
{
this
.
id
=
readerEventsId
;
}
public
ReaderEvent
(
Integer
readerEventsId
,
Calendar
eventTime
)
{
public
ReaderEvent
(
EventPk
readerEventsId
,
Calendar
eventTime
)
{
this
.
id
=
readerEventsId
;
this
.
time
=
eventTime
;
}
...
...
@@ -133,7 +132,7 @@ public class ReaderEvent implements ModelInterface {
* @return the id
*/
@Override
public
Integer
getId
()
{
public
EventPk
getId
()
{
return
id
;
}
...
...
@@ -142,7 +141,7 @@ public class ReaderEvent implements ModelInterface {
* the id to set
*/
@Override
public
void
setId
(
Integer
id
)
{
public
void
setId
(
EventPk
id
)
{
this
.
id
=
id
;
}
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Role.java
View file @
ee7c91c
...
...
@@ -8,6 +8,7 @@ import java.util.List;
import
javax.persistence.CascadeType
;
import
javax.persistence.Column
;
import
javax.persistence.EmbeddedId
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
...
...
@@ -30,14 +31,13 @@ import javax.persistence.Version;
@NamedQueries
(
{
@NamedQuery
(
name
=
"Role.findAll"
,
query
=
"SELECT r FROM Role r"
),
@NamedQuery
(
name
=
"Role.findByRoleName"
,
query
=
"SELECT r FROM Role r WHERE r.name = :name"
)
})
public
class
Role
implements
ModelInterface
{
public
class
Role
implements
EventChildInterface
{
private
static
final
long
serialVersionUID
=
1L
;
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"roles_id"
,
nullable
=
false
)
private
Integer
id
;
@EmbeddedId
private
EventPk
id
;
@Column
(
name
=
"role_name"
,
nullable
=
false
)
private
String
name
;
...
...
@@ -78,11 +78,11 @@ public class Role implements ModelInterface {
public
Role
()
{
}
public
Role
(
Integer
rolesId
)
{
public
Role
(
EventPk
rolesId
)
{
this
.
id
=
rolesId
;
}
public
Role
(
Integer
rolesId
,
String
roleName
)
{
public
Role
(
EventPk
rolesId
,
String
roleName
)
{
this
.
id
=
rolesId
;
this
.
name
=
roleName
;
}
...
...
@@ -150,7 +150,7 @@ public class Role implements ModelInterface {
* @return the id
*/
@Override
public
Integer
getId
()
{
public
EventPk
getId
()
{
return
id
;
}
...
...
@@ -159,7 +159,7 @@ public class Role implements ModelInterface {
* the id to set
*/
@Override
public
void
setId
(
Integer
id
)
{
public
void
setId
(
EventPk
id
)
{
this
.
id
=
id
;
}
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/RoleRight.java
View file @
ee7c91c
...
...
@@ -5,6 +5,7 @@
package
fi
.
insomnia
.
bortal
.
model
;
import
javax.persistence.Column
;
import
javax.persistence.EmbeddedId
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
...
...
@@ -35,13 +36,11 @@ import javax.persistence.Version;
* @ NamedQuery ( name = "RoleRight.findByExecute" , query =
* "SELECT r FROM RoleRight r WHERE r.execute = :execute" )
*/
})
public
class
RoleRight
implements
ModelInterface
{
public
class
RoleRight
implements
EventChildInterface
{
private
static
final
long
serialVersionUID
=
1L
;
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"role_rights_id"
,
nullable
=
false
)
private
Integer
id
;
@EmbeddedId
private
EventPk
id
;
@Column
(
name
=
"read_permission"
,
nullable
=
false
)
private
boolean
read
;
...
...
@@ -67,11 +66,11 @@ public class RoleRight implements ModelInterface {
public
RoleRight
()
{
}
public
RoleRight
(
Integer
roleRights
)
{
public
RoleRight
(
EventPk
roleRights
)
{
this
.
id
=
roleRights
;
}
public
RoleRight
(
Integer
roleRights
,
boolean
read
,
boolean
write
)
{
public
RoleRight
(
EventPk
roleRights
,
boolean
read
,
boolean
write
)
{
this
.
id
=
roleRights
;
this
.
read
=
read
;
this
.
write
=
write
;
...
...
@@ -140,7 +139,7 @@ public class RoleRight implements ModelInterface {
* @return the id
*/
@Override
public
Integer
getId
()
{
public
EventPk
getId
()
{
return
id
;
}
...
...
@@ -149,7 +148,7 @@ public class RoleRight implements ModelInterface {
* the id to set
*/
@Override
public
void
setId
(
Integer
id
)
{
public
void
setId
(
EventPk
id
)
{
this
.
id
=
id
;
}
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/User.java
View file @
ee7c91c
...
...
@@ -46,7 +46,7 @@ import javax.persistence.Version;
@NamedQuery
(
name
=
"User.findByPhone"
,
query
=
"SELECT u FROM User u WHERE u.phone = :phone"
),
@NamedQuery
(
name
=
"User.findByFemale"
,
query
=
"SELECT u FROM User u WHERE u.female = :female"
),
@NamedQuery
(
name
=
"User.findByLogin"
,
query
=
"SELECT u FROM User u WHERE u.login = :login"
)
})
public
class
User
implements
ModelInterface
{
public
class
User
implements
ModelInterface
<
Integer
>
{
private
static
final
long
serialVersionUID
=
1L
;
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/UserImage.java
View file @
ee7c91c
...
...
@@ -5,6 +5,7 @@
package
fi
.
insomnia
.
bortal
.
model
;
import
javax.persistence.Column
;
import
javax.persistence.EmbeddedId
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
...
...
@@ -28,14 +29,12 @@ import javax.persistence.Version;
@NamedQuery
(
name
=
"UserImage.findByName"
,
query
=
"SELECT u FROM UserImage u WHERE u.name = :name"
),
@NamedQuery
(
name
=
"UserImage.findByDescription"
,
query
=
"SELECT u FROM UserImage u WHERE u.description = :description"
),
@NamedQuery
(
name
=
"UserImage.findByMimeType"
,
query
=
"SELECT u FROM UserImage u WHERE u.mimeType = :mimeType"
)
})
public
class
UserImage
implements
ModelInterface
{
public
class
UserImage
implements
EventChildInterface
{
private
static
final
long
serialVersionUID
=
1L
;
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"user_images_id"
,
nullable
=
false
)
private
Integer
id
;
@EmbeddedId
private
EventPk
id
;
@Column
(
name
=
"name"
)
private
String
name
;
...
...
@@ -62,7 +61,7 @@ public class UserImage implements ModelInterface {
public
UserImage
()
{
}
public
UserImage
(
Integer
userImagesId
)
{
public
UserImage
(
EventPk
userImagesId
)
{
this
.
id
=
userImagesId
;
}
...
...
@@ -129,7 +128,7 @@ public class UserImage implements ModelInterface {
* @return the id
*/
@Override
public
Integer
getId
()
{
public
EventPk
getId
()
{
return
id
;
}
...
...
@@ -138,7 +137,7 @@ public class UserImage implements ModelInterface {
* the id to set
*/
@Override
public
void
setId
(
Integer
id
)
{
public
void
setId
(
EventPk
id
)
{
this
.
id
=
id
;
}
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Vote.java
View file @
ee7c91c
...
...
@@ -7,6 +7,7 @@ package fi.insomnia.bortal.model;
import
java.util.Calendar
;
import
javax.persistence.Column
;
import
javax.persistence.EmbeddedId
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
...
...
@@ -32,13 +33,11 @@ import javax.persistence.Version;
@NamedQuery
(
name
=
"Vote.findByScore"
,
query
=
"SELECT v FROM Vote v WHERE v.score = :score"
),
@NamedQuery
(
name
=
"Vote.findByTime"
,
query
=
"SELECT v FROM Vote v WHERE v.time = :time"
)
})
public
class
Vote
implements
ModelInterface
{
public
class
Vote
implements
EventChildInterface
{
private
static
final
long
serialVersionUID
=
1L
;
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"votes_id"
,
nullable
=
false
)
private
Integer
id
;
@EmbeddedId
private
EventPk
id
;
@Column
(
name
=
"score"
)
private
Integer
score
;
@Column
(
name
=
"vote_time"
,
nullable
=
false
)
...
...
@@ -57,22 +56,22 @@ public class Vote implements ModelInterface {
public
Vote
()
{
}
public
Vote
(
Integer
votesId
)
{
public
Vote
(
EventPk
votesId
)
{
this
.
id
=
votesId
;
}
public
Vote
(
Integer
votesId
,
Calendar
voteTime
)
{
public
Vote
(
EventPk
votesId
,
Calendar
voteTime
)
{
this
.
id
=
votesId
;
this
.
time
=
voteTime
;
}
@Override
public
Integer
getId
()
{
public
EventPk
getId
()
{
return
id
;
}
@Override
public
void
setId
(
Integer
votesId
)
{
public
void
setId
(
EventPk
votesId
)
{
this
.
id
=
votesId
;
}
...
...
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