Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Riina Antikainen
/
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 48a14a49
authored
May 09, 2010
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Muutettu persistence cache pois päältä ja jotain muuta pientä viilausta..
1 parent
c0ce1592
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
51 additions
and
11 deletions
code/LanBortalAuthModule.jar
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/BillLineBean.java
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/BillLineBeanLocal.java
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/TestDataBean.java
code/LanBortalBeansClient/ejbModule/fi/insomnia/bortal/enums/Role.java
code/LanBortalDatabase/src/META-INF/persistence.xml
code/LanBortalDatabase/src/fi/insomnia/bortal/model/EventMap.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Place.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/User.java
code/LanBortalAuthModule.jar
View file @
48a14a4
No preview for this file type
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/BillLineBean.java
0 → 100644
View file @
48a14a4
package
fi
.
insomnia
.
bortal
.
beans
;
import
javax.ejb.Stateless
;
/**
* Session Bean implementation class BillLineBean
*/
@Stateless
public
class
BillLineBean
implements
BillLineBeanLocal
{
/**
* Default constructor.
*/
public
BillLineBean
()
{
// TODO Auto-generated constructor stub
}
}
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/BillLineBeanLocal.java
0 → 100644
View file @
48a14a4
package
fi
.
insomnia
.
bortal
.
beans
;
import
javax.ejb.Local
;
@Local
public
interface
BillLineBeanLocal
{
}
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/TestDataBean.java
View file @
48a14a4
...
...
@@ -35,7 +35,7 @@ import java.util.List;
*/
@Stateless
@DeclareRoles
(
JaasBean
.
JAAS_SUPERADMINGROUP
)
@RolesAllowed
(
JaasBean
.
JAAS_SUPERADMINGROUP
)
//
@RolesAllowed(JaasBean.JAAS_SUPERADMINGROUP)
public
class
TestDataBean
implements
TestDataBeanLocal
{
public
static
final
String
TEST_MAP_IMAGE_NAME
=
"testmap.png"
;
...
...
code/LanBortalBeansClient/ejbModule/fi/insomnia/bortal/enums/Role.java
0 → 100644
View file @
48a14a4
package
fi
.
insomnia
.
bortal
.
enums
;
public
enum
Role
{
}
code/LanBortalDatabase/src/META-INF/persistence.xml
View file @
48a14a4
...
...
@@ -5,6 +5,8 @@
<properties>
<property
name=
"eclipselink.ddl-generation"
value=
"drop-and-create-tables"
/>
<property
name=
"eclipselink.ddl-generation.output-mode"
value=
"both"
/>
<property
name=
"eclipselink.logging.level"
value=
"ALL"
/>
<property
name=
"eclipselink.cache.type.default"
value=
"NONE"
/>
</properties>
</persistence-unit>
</persistence>
code/LanBortalDatabase/src/fi/insomnia/bortal/model/EventMap.java
View file @
48a14a4
...
...
@@ -7,6 +7,7 @@ package fi.insomnia.bortal.model;
import
java.awt.image.BufferedImage
;
import
java.io.ByteArrayInputStream
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.List
;
import
javax.imageio.ImageIO
;
...
...
@@ -23,6 +24,8 @@ import javax.persistence.OneToMany;
import
javax.persistence.Table
;
import
javax.persistence.Version
;
import
org.eclipse.persistence.annotations.Cache
;
import
org.eclipse.persistence.annotations.CacheType
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -32,8 +35,9 @@ import org.slf4j.LoggerFactory;
@Entity
@Table
(
name
=
"maps"
)
@NamedQueries
({
@NamedQuery
(
name
=
"EventMap.findAll"
,
query
=
"SELECT e FROM EventMap e"
),
@NamedQuery
(
name
=
"EventMap.findByName"
,
query
=
"SELECT e FROM EventMap e WHERE e.name = :name"
)})
@NamedQuery
(
name
=
"EventMap.findAll"
,
query
=
"SELECT e FROM EventMap e"
),
@NamedQuery
(
name
=
"EventMap.findByName"
,
query
=
"SELECT e FROM EventMap e WHERE e.name = :name"
)
})
@Cache
(
type
=
CacheType
.
NONE
)
public
class
EventMap
implements
EventChildInterface
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
EventMap
.
class
);
...
...
@@ -46,7 +50,7 @@ public class EventMap implements EventChildInterface {
@Column
(
name
=
"map_name"
)
private
String
name
;
@OneToMany
(
cascade
=
CascadeType
.
ALL
,
mappedBy
=
"map"
)
private
List
<
Place
>
places
;
private
List
<
Place
>
places
=
new
ArrayList
<
Place
>()
;
@ManyToOne
(
optional
=
false
)
@JoinColumn
(
name
=
"event_id"
,
referencedColumnName
=
"event_id"
,
insertable
=
false
,
updatable
=
false
,
nullable
=
false
)
private
Event
event
;
...
...
@@ -168,7 +172,7 @@ public class EventMap implements EventChildInterface {
BufferedImage
image
=
ImageIO
.
read
(
new
ByteArrayInputStream
(
getMapData
()));
List
<
Place
>
myplaces
=
getPlaces
();
logger
.
info
(
"Getting places in Event map {}, found {}"
,
this
,
myplaces
.
size
());
for
(
Place
place
:
myplaces
)
{
place
.
drawPlace
(
image
);
}
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Place.java
View file @
48a14a4
...
...
@@ -22,6 +22,9 @@ import javax.persistence.OneToOne;
import
javax.persistence.Table
;
import
javax.persistence.Version
;
import
org.eclipse.persistence.annotations.Cache
;
import
org.eclipse.persistence.annotations.CacheType
;
/**
*
*/
...
...
@@ -35,6 +38,7 @@ 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"
)
})
@Cache
(
type
=
CacheType
.
NONE
)
public
class
Place
implements
EventChildInterface
{
private
static
final
long
serialVersionUID
=
1L
;
...
...
@@ -56,12 +60,13 @@ public class Place implements EventChildInterface {
@Column
(
name
=
"place_details"
)
@Lob
private
String
details
;
@Column
(
name
=
"place_code"
)
private
String
code
;
@OneToOne
(
mappedBy
=
"placeReservation"
)
private
GroupMembership
placeReserver
;
/**
* Which group has bought the place
*/
...
...
@@ -71,12 +76,12 @@ public class Place implements EventChildInterface {
@ManyToOne
private
PlaceGroup
group
;
@JoinColumns
({
@JoinColumn
(
name
=
"map_id"
,
referencedColumnName
=
"id"
),
@JoinColumn
(
name
=
"map_id"
,
referencedColumnName
=
"id"
,
nullable
=
false
,
updatable
=
true
,
insertable
=
true
),
@JoinColumn
(
name
=
"event_id"
,
referencedColumnName
=
"event_id"
,
nullable
=
false
,
updatable
=
false
,
insertable
=
false
)
})
@ManyToOne
(
optional
=
false
)
private
EventMap
map
;
/**
* Which ticket type is this place sold as
*/
...
...
@@ -102,7 +107,7 @@ public class Place implements EventChildInterface {
public
Place
(
EventMap
eventMap
)
{
this
.
id
=
new
EventPk
();
this
.
id
.
setEventId
(
eventMap
.
getId
().
getEventId
());
}
public
String
getDescription
()
{
...
...
@@ -173,7 +178,7 @@ public class Place implements EventChildInterface {
throw
new
RuntimeException
(
"Can not set Map from different Event to Place!"
);
}
this
.
map
=
map
;
//
this.mapId = map.getId().getId();
//
this.mapId = map.getId().getId();
}
public
Product
getProduct
()
{
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/User.java
View file @
48a14a4
...
...
@@ -46,7 +46,6 @@ import fi.insomnia.bortal.utilities.PasswordFunctions;
@NamedQuery
(
name
=
"User.findByEmail"
,
query
=
"SELECT u FROM User u WHERE u.email = :email"
),
@NamedQuery
(
name
=
"User.findByAddress"
,
query
=
"SELECT u FROM User u WHERE u.address = :address"
),
@NamedQuery
(
name
=
"User.findByZip"
,
query
=
"SELECT u FROM User u WHERE u.zip = :zip"
),
@NamedQuery
(
name
=
"User.findByPostalCode"
,
query
=
"SELECT u FROM User u WHERE u.postalCode = :postalCode"
),
@NamedQuery
(
name
=
"User.findByTown"
,
query
=
"SELECT u FROM User u WHERE u.town = :town"
),
@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"
),
...
...
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