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 708de524
authored
Mar 08, 2010
by
Juho Juopperi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
persistence changes
1 parent
fc9271d2
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
6 deletions
code/LanBortalDatabase/src/META-INF/persistence.xml
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Location.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/User.java
code/LanBortalDatabase/src/META-INF/persistence.xml
View file @
708de52
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<persistence
version=
"1.0"
xmlns=
"http://java.sun.com/xml/ns/persistence"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
>
<persistence
version=
"1.0"
xmlns=
"http://java.sun.com/xml/ns/persistence"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
>
<persistence-unit
name=
"BortalDb"
>
<persistence-unit
name=
"BortalDb"
>
<jta-data-source>
jdbc/bortal
Database
</jta-data-source>
<jta-data-source>
jdbc/bortal
</jta-data-source>
<properties>
<properties>
<property
name=
"eclipselink.ddl-generation"
value=
"create-tables"
/>
<property
name=
"eclipselink.ddl-generation"
value=
"
drop-and-
create-tables"
/>
<property
name=
"eclipselink.ddl-generation.output-mode"
value=
"database"
/>
<property
name=
"eclipselink.ddl-generation.output-mode"
value=
"database"
/>
</properties>
</properties>
</persistence-unit>
</persistence-unit>
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Location.java
View file @
708de52
...
@@ -24,6 +24,7 @@ import javax.persistence.Version;
...
@@ -24,6 +24,7 @@ import javax.persistence.Version;
@Table
(
name
=
"locations"
)
@Table
(
name
=
"locations"
)
@NamedQueries
({
@NamedQueries
({
@NamedQuery
(
name
=
"Location.findAll"
,
query
=
"SELECT l FROM Location l"
),
@NamedQuery
(
name
=
"Location.findAll"
,
query
=
"SELECT l FROM Location l"
),
@NamedQuery
(
name
=
"Location.findByLocationName"
,
query
=
"SELECT l FROM Location l WHERE l.name = :name"
)
})
@NamedQuery
(
name
=
"Location.findByLocationName"
,
query
=
"SELECT l FROM Location l WHERE l.name = :name"
)
})
public
class
Location
implements
ModelInterface
{
public
class
Location
implements
ModelInterface
{
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/User.java
View file @
708de52
...
@@ -52,22 +52,23 @@ public class User implements ModelInterface {
...
@@ -52,22 +52,23 @@ public class User implements ModelInterface {
@Id
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"users_id"
,
nullable
=
false
)
@Column
(
name
=
"users_id"
,
nullable
=
false
)
@GeneratedValue
(
strategy
=
GenerationType
.
SEQUENCE
)
private
Integer
id
;
private
Integer
id
;
@Column
(
name
=
"created"
,
nullable
=
false
)
@Column
(
name
=
"created"
,
nullable
=
false
,
columnDefinition
=
"timestamptz default now()"
)
@Temporal
(
TemporalType
.
TIMESTAMP
)
@Temporal
(
TemporalType
.
TIMESTAMP
)
private
Calendar
created
;
private
Calendar
created
;
@Column
(
name
=
"active"
,
nullable
=
false
)
@Column
(
name
=
"active"
,
nullable
=
false
,
columnDefinition
=
"boolean default true"
)
private
boolean
active
;
private
boolean
active
;
@Column
(
name
=
"password"
)
@Column
(
name
=
"password"
)
private
String
password
;
private
String
password
;
@Column
(
name
=
"lastname"
,
nullable
=
false
)
@Column
(
name
=
"lastname"
)
private
String
lastname
;
private
String
lastname
;
@Column
(
name
=
"firstnames"
,
nullable
=
false
)
@Column
(
name
=
"firstnames"
)
private
String
firstnames
;
private
String
firstnames
;
@Column
(
name
=
"birthday"
)
@Column
(
name
=
"birthday"
)
...
...
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