Commit ebf477aa by Tuukka Kivilahti

see diff

1 parent e22e4f0b
...@@ -12,6 +12,8 @@ import javax.persistence.Entity; ...@@ -12,6 +12,8 @@ import javax.persistence.Entity;
import javax.persistence.GeneratedValue; import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType; import javax.persistence.GenerationType;
import javax.persistence.Id; import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries; import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery; import javax.persistence.NamedQuery;
import javax.persistence.OneToMany; import javax.persistence.OneToMany;
...@@ -36,15 +38,20 @@ public class EventSettings implements ModelInterface { ...@@ -36,15 +38,20 @@ public class EventSettings implements ModelInterface {
@Column(name = "event_settings_id", nullable = false) @Column(name = "event_settings_id", nullable = false)
private Integer id; private Integer id;
@Column(name = "base_name") @Column(name = "organisation")
private String baseName; private String organisation;
@Column(name = "style_sheet") @Column(name = "bundle_country")
private String styleSheet; private String bundleCountry;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "settings") @OneToMany(cascade = CascadeType.ALL, mappedBy = "settings")
private List<Event> events; private List<Event> events;
@ManyToOne
@JoinColumn(name = "users_id", referencedColumnName = "users_id", nullable = false)
private User admin;
@Version @Version
@Column(nullable = false) @Column(nullable = false)
private int jpaVersionField; private int jpaVersionField;
...@@ -56,22 +63,6 @@ public class EventSettings implements ModelInterface { ...@@ -56,22 +63,6 @@ public class EventSettings implements ModelInterface {
this.id = eventSettingsId; this.id = eventSettingsId;
} }
public String getBaseName() {
return baseName;
}
public void setBaseName(String resourceBundle) {
this.baseName = resourceBundle;
}
public String getStyleSheet() {
return styleSheet;
}
public void setStyleSheet(String styleSheet) {
this.styleSheet = styleSheet;
}
public List<Event> getEvents() { public List<Event> getEvents() {
return events; return events;
} }
...@@ -140,4 +131,46 @@ public class EventSettings implements ModelInterface { ...@@ -140,4 +131,46 @@ public class EventSettings implements ModelInterface {
public void setJpaVersionField(int jpaVersionField) { public void setJpaVersionField(int jpaVersionField) {
this.jpaVersionField = jpaVersionField; this.jpaVersionField = jpaVersionField;
} }
/**
* @return the organisation
*/
public String getOrganisation() {
return organisation;
}
/**
* @param organisation the organisation to set
*/
public void setOrganisation(String organisation) {
this.organisation = organisation;
}
/**
* @return the bundleCountry
*/
public String getBundleCountry() {
return bundleCountry;
}
/**
* @param bundleCountry the bundleCountry to set
*/
public void setBundleCountry(String bundleCountry) {
this.bundleCountry = bundleCountry;
}
/**
* @return the admin
*/
public User getAdmin() {
return admin;
}
/**
* @param admin the admin to set
*/
public void setAdmin(User admin) {
this.admin = admin;
}
} }
...@@ -171,6 +171,10 @@ public class User implements ModelInterface { ...@@ -171,6 +171,10 @@ public class User implements ModelInterface {
@Column(nullable = false) @Column(nullable = false)
private int jpaVersionField; private int jpaVersionField;
@OneToMany(mappedBy = "admin")
private List<EventSettings> eventSettings;
public User() { public User() {
} }
...@@ -516,4 +520,18 @@ public class User implements ModelInterface { ...@@ -516,4 +520,18 @@ public class User implements ModelInterface {
public void setConfirmTime(Calendar confirmTime) { public void setConfirmTime(Calendar confirmTime) {
this.confirmTime = confirmTime; this.confirmTime = confirmTime;
} }
/**
* @return the eventSettings
*/
public List<EventSettings> getEventSettings() {
return eventSettings;
}
/**
* @param eventSettings the eventSettings to set
*/
public void setEventSettings(List<EventSettings> eventSettings) {
this.eventSettings = eventSettings;
}
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!