Commit 04b06988 by Tuomas Riihimäki

Added eventId constructor to EventPk

1 parent 02bbcf3d
......@@ -46,21 +46,13 @@ public class PlaceMapBean implements PlaceMapBeanLocal {
EventMap map = null;
if (placeId != null) {
EventPk pk = new EventPk();
pk.setEventId(eventId);
pk.setId(placeId);
place = placeFacade.find(eventId, placeId);
}
if (place != null) {
map = place.getMap();
} else {
EventPk pk = new EventPk();
pk.setEventId(eventId);
pk.setId(mapId);
map = eventMapFacade.find(pk);
map = eventMapFacade.find(eventId,mapId);
}
BufferedImage image = map.getMapWithPlaces();
......@@ -69,7 +61,7 @@ public class PlaceMapBean implements PlaceMapBeanLocal {
User user = userFacade.find(userId);
if (user != null) {
for (PlaceGroup uplacegroup : user.getPlaceGroupList()) {
for (PlaceGroup uplacegroup : user.getPlaceGroups()) {
for (Place uplace : uplacegroup.getPlaces())
uplace.drawOwnedPlace(image);
}
......
......@@ -6,21 +6,17 @@ import fi.insomnia.bortal.model.EventPk;
/**
* Session Bean implementation class GenericFacade
*/
public abstract class EventChildGenericFacade<T extends EventChildInterface> extends GenericFacade<EventPk,T> {
public abstract class EventChildGenericFacade<T extends EventChildInterface> extends GenericFacade<EventPk, T> {
public EventChildGenericFacade(Class<T> entityClass) {
super(entityClass);
}
public T find(Integer eventId, Integer id)
{
EventPk pk = new EventPk();
pk.setEventId(eventId);
public T find(Integer eventId, Integer id) {
EventPk pk = new EventPk(eventId);
pk.setId(id);
return find(pk);
}
}
......@@ -30,6 +30,11 @@ public class EventPk implements Serializable {
super();
this.eventId = event.getId();
}
public EventPk(Integer eventId) {
super();
this.eventId = eventId;
}
public void setId(Integer id) {
this.id = id;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!