Commit 2c9e4f1a by Tuomas Riihimäki

Add width and height to EventMap

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