Commit 48a14a49 by Tuomas Riihimäki

Muutettu persistence cache pois päältä ja jotain muuta pientä viilausta..

1 parent c0ce1592
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
}
}
package fi.insomnia.bortal.beans;
import javax.ejb.Local;
@Local
public interface BillLineBeanLocal {
}
......@@ -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";
......
package fi.insomnia.bortal.enums;
public enum Role {
}
......@@ -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>
......@@ -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);
}
......
......@@ -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() {
......
......@@ -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"),
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!