Commit 2c9e4f1a by Tuomas Riihimäki

Add width and height to EventMap

1 parent 690b826c
......@@ -225,11 +225,11 @@ public class BootstrapBean implements BootstrapBeanLocal {
"ALTER TABLE group_memberships ADD COLUMN place_product INTEGER",
"ALTER TABLE group_memberships ADD CONSTRAINT FK_group_memberships_place_product FOREIGN KEY (place_product) REFERENCES products (id)"
});
dbUpdates.add(new String[] {
"ALTER TABLE events ADD COLUMN ticket_sales_begin timestamp without time zone DEFAULT null;",
});
dbUpdates.add(new String[] {
"ALTER TABLE events ADD COLUMN theme varchar(255) DEFAULT null;",
});
......@@ -239,12 +239,15 @@ public class BootstrapBean implements BootstrapBeanLocal {
dbUpdates.add(new String[] {
"DELETE FROM product_productflags where productflags = 'PREPAID_INSTANT_CREATE'"
});
dbUpdates.add(new String[] {
"ALTER TABLE food_wave_templates ADD COLUMN wait_payments_minutes integer DEFAULT null;",
});
dbUpdates.add(new String[] {
"ALTER TABLE maps ADD COLUMN width integer",
"ALTER TABLE maps ADD COLUMN height integer",
});
} // start_time timestamp without time zone,
......@@ -298,16 +301,16 @@ public class BootstrapBean implements BootstrapBeanLocal {
dbModelFacade.create(dBm);
}
}
// We will never run this again with empty database
// public void saneDefaults() {
// User adminUser = userFacade.findByLogin("admin");
// if (adminUser == null) {
// adminUser = new User();
// adminUser.setLogin("admin");
// // adminUser.setSuperadmin(true);
// adminUser.resetPassword("admin");
// userFacade.create(adminUser);
// }
// }
// We will never run this again with empty database
// public void saneDefaults() {
// User adminUser = userFacade.findByLogin("admin");
// if (adminUser == null) {
// adminUser = new User();
// adminUser.setLogin("admin");
// // adminUser.setSuperadmin(true);
// adminUser.resetPassword("admin");
// userFacade.create(adminUser);
// }
// }
}
......@@ -39,103 +39,125 @@ import org.eclipse.persistence.annotations.PrivateOwned;
@Table(name = "maps")
public class EventMap extends GenericEntity {
private static final long serialVersionUID = 3411450245513673619L;
@ManyToOne()
private LanEvent event;
public LanEvent getEvent() {
return event;
}
public void setEvent(LanEvent event) {
this.event = event;
}
@Lob
@Column(name = "map_data")
private byte[] mapData;
@Column(name = "map_name")
private String name;
@OrderBy("name")
@OneToMany(cascade = CascadeType.ALL, mappedBy = "map")
@PrivateOwned
private List<Place> places = new ArrayList<Place>();
@OneToMany(mappedBy = "eventMap")
private List<Reader> readers;
@Column(nullable = false)
private boolean active = true;
@Column(name = "notes")
@Lob
private String notes;
public EventMap() {
super();
}
public EventMap(LanEvent event) {
super();
this.event = event;
}
public String getName() {
return name;
}
public void setName(String mapName) {
this.name = mapName;
}
public List<Place> getPlaces() {
return places;
}
public void setPlaces(List<Place> placeList) {
this.places = placeList;
}
/**
* @return the readers
*/
public List<Reader> getReaders() {
return readers;
}
/**
* @param readers
* the readers to set
*/
public void setReaders(List<Reader> readers) {
this.readers = readers;
}
public void setMapData(byte[] mapData) {
this.mapData = mapData;
}
public byte[] getMapData() {
return mapData;
}
public void setActive(boolean active) {
this.active = active;
}
public boolean isActive() {
return active;
}
public void setNotes(String notes) {
this.notes = notes;
}
public String getNotes() {
return notes;
}
private static final long serialVersionUID = 3411450245513673619L;
@ManyToOne()
private LanEvent event;
public LanEvent getEvent() {
return event;
}
public void setEvent(LanEvent event) {
this.event = event;
}
@Lob
@Column(name = "map_data")
private byte[] mapData;
@Column(name = "map_name")
private String name;
@OrderBy("name")
@OneToMany(cascade = CascadeType.ALL, mappedBy = "map")
@PrivateOwned
private List<Place> places = new ArrayList<Place>();
@OneToMany(mappedBy = "eventMap")
private List<Reader> readers;
@Column(nullable = false)
private boolean active = true;
@Column(name = "notes")
@Lob
private String notes;
@Column()
private Integer width;
@Column()
private Integer height;
public EventMap() {
super();
}
public EventMap(LanEvent event) {
super();
this.event = event;
}
public String getName() {
return name;
}
public void setName(String mapName) {
this.name = mapName;
}
public List<Place> getPlaces() {
return places;
}
public void setPlaces(List<Place> placeList) {
this.places = placeList;
}
/**
* @return the readers
*/
public List<Reader> getReaders() {
return readers;
}
/**
* @param readers
* the readers to set
*/
public void setReaders(List<Reader> readers) {
this.readers = readers;
}
public void setMapData(byte[] mapData) {
this.mapData = mapData;
}
public byte[] getMapData() {
return mapData;
}
public void setActive(boolean active) {
this.active = active;
}
public boolean isActive() {
return active;
}
public void setNotes(String notes) {
this.notes = notes;
}
public String getNotes() {
return notes;
}
public Integer getWidth() {
return width;
}
public void setWidth(Integer width) {
this.width = width;
}
public Integer getHeight() {
return height;
}
public void setHeight(Integer height) {
this.height = height;
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!