Commit 166211b2 by jkj

model cleanup

git-svn-id: https://dev.intra.insomnia.fi/svn/trunk@59 8cf89bec-f6a3-4178-919f-364fb3449fe5
1 parent 57f87311
......@@ -48,6 +48,9 @@ public class CardTemplate implements ModelInterface {
@OneToMany(mappedBy = "cardTemplate")
private List<Role> roles;
@OneToMany(mappedBy = "cardTemplate")
private List<PrintedCard> cards;
@Version
@Column(nullable = false)
private int jpaVersionField;
......@@ -139,4 +142,12 @@ public class CardTemplate implements ModelInterface {
return jpaVersionField;
}
public void setCards(List<PrintedCard> cards) {
this.cards = cards;
}
public List<PrintedCard> getCards() {
return cards;
}
}
......@@ -17,14 +17,13 @@ import javax.persistence.Version;
/**
*
* @author jkj
*/
@Entity
@Table(name = "locations")
@NamedQueries( {
@NamedQuery(name = "Location.findAll", query = "SELECT l FROM Location l"),
@NamedQuery(name = "Location.findByLocationsId", query = "SELECT l FROM Location l WHERE l.locationsId = :locationsId"),
@NamedQuery(name = "Location.findByLocationName", query = "SELECT l FROM Location l WHERE l.locationName = :locationName") })
@NamedQuery(name = "Location.findById", query = "SELECT l FROM Location l WHERE l.id = :id"),
@NamedQuery(name = "Location.findByLocationName", query = "SELECT l FROM Location l WHERE l.locationName = :name") })
public class Location implements ModelInterface {
private static final long serialVersionUID = 1L;
......@@ -33,11 +32,14 @@ public class Location implements ModelInterface {
private Integer id;
@Column(name = "location_name", nullable = false)
private String locationName;
@OneToMany(mappedBy = "locationsId")
private List<Reader> readerList;
private String name;
@OneToMany(mappedBy = "id")
private List<Reader> readers;
@OneToMany(mappedBy = "currentLocation")
private List<PrintedCard> printedCardList;
private List<PrintedCard> printedCardsAtLocation;
@Version
@Column(nullable = false)
private int jpaVersionField;
......@@ -51,31 +53,31 @@ public class Location implements ModelInterface {
public Location(Integer locationsId, String locationName) {
this.id = locationsId;
this.locationName = locationName;
this.name = locationName;
}
public String getLocationName() {
return locationName;
public String getName() {
return name;
}
public void setLocationName(String locationName) {
this.locationName = locationName;
public void setName(String locationName) {
this.name = locationName;
}
public List<Reader> getReaderList() {
return readerList;
public List<Reader> getReaders() {
return readers;
}
public void setReaderList(List<Reader> readerList) {
this.readerList = readerList;
public void setReaders(List<Reader> readerList) {
this.readers = readerList;
}
public List<PrintedCard> getPrintedCardList() {
return printedCardList;
public List<PrintedCard> getPrintedCardsAtLocation() {
return printedCardsAtLocation;
}
public void setPrintedCardList(List<PrintedCard> printedCardList) {
this.printedCardList = printedCardList;
public void setPrintedCardsAtLocation(List<PrintedCard> printedCardList) {
this.printedCardsAtLocation = printedCardList;
}
@Override
......@@ -102,7 +104,7 @@ public class Location implements ModelInterface {
@Override
public String toString() {
return "fi.insomnia.bortal.model.Location[locationsId=" + getId() + "]";
return "fi.insomnia.bortal.model.Location[id=" + getId() + "]";
}
/**
......
......@@ -20,33 +20,37 @@ import javax.persistence.Version;
/**
*
* @author jkj
*/
@Entity
@Table(name = "event_log")
@NamedQueries( {
@NamedQuery(name = "LogEntry.findAll", query = "SELECT l FROM LogEntry l"),
@NamedQuery(name = "LogEntry.findByEventLogId", query = "SELECT l FROM LogEntry l WHERE l.eventLogId = :eventLogId"),
@NamedQuery(name = "LogEntry.findByEventTime", query = "SELECT l FROM LogEntry l WHERE l.eventTime = :eventTime"),
@NamedQuery(name = "LogEntry.findByEventDescription", query = "SELECT l FROM LogEntry l WHERE l.eventDescription = :eventDescription") })
@NamedQuery(name = "LogEntry.findById", query = "SELECT l FROM LogEntry l WHERE l.id = :id"),
@NamedQuery(name = "LogEntry.findByTime", query = "SELECT l FROM LogEntry l WHERE l.time = :time"),
@NamedQuery(name = "LogEntry.findByDescription", query = "SELECT l FROM LogEntry l WHERE l.description = :description") })
public class LogEntry implements ModelInterface {
private static final long serialVersionUID = 1L;
@Id
@Column(name = "event_log_id", nullable = false)
private Integer id;
@Column(name = "event_time", nullable = false)
@Temporal(TemporalType.TIMESTAMP)
private Date eventTime;
private Date time;
@Column(name = "event_description")
private String eventDescription;
private String description;
@JoinColumn(name = "event_log_types_id", referencedColumnName = "event_log_types_id", nullable = false)
@ManyToOne(optional = false)
private LogEntryType eventLogTypesId;
private LogEntryType type;
@JoinColumn(name = "users_id", referencedColumnName = "users_id")
@ManyToOne
private User usersId;
private User user;
@Version
@Column(nullable = false)
private int jpaVersionField;
......@@ -60,39 +64,39 @@ public class LogEntry implements ModelInterface {
public LogEntry(Integer eventLogId, Date eventTime) {
this.id = eventLogId;
this.eventTime = eventTime;
this.time = eventTime;
}
public Date getEventTime() {
return eventTime;
public Date getTime() {
return time;
}
public void setEventTime(Date eventTime) {
this.eventTime = eventTime;
public void setTime(Date eventTime) {
this.time = eventTime;
}
public String getEventDescription() {
return eventDescription;
public String getDescription() {
return description;
}
public void setEventDescription(String eventDescription) {
this.eventDescription = eventDescription;
public void setDescription(String eventDescription) {
this.description = eventDescription;
}
public LogEntryType getEventLogTypesId() {
return eventLogTypesId;
public LogEntryType getType() {
return type;
}
public void setEventLogTypesId(LogEntryType eventLogTypesId) {
this.eventLogTypesId = eventLogTypesId;
public void setType(LogEntryType eventLogTypesId) {
this.type = eventLogTypesId;
}
public User getUsersId() {
return usersId;
public User getUser() {
return user;
}
public void setUsersId(User usersId) {
this.usersId = usersId;
public void setUser(User usersId) {
this.user = usersId;
}
@Override
......
......@@ -18,25 +18,27 @@ import javax.persistence.Version;
/**
*
* @author jkj
*/
@Entity
@Table(name = "event_log_types")
@NamedQueries( {
@NamedQuery(name = "LogEntryType.findAll", query = "SELECT l FROM LogEntryType l"),
@NamedQuery(name = "LogEntryType.findByEventLogTypesId", query = "SELECT l FROM LogEntryType l WHERE l.eventLogTypesId = :eventLogTypesId"),
@NamedQuery(name = "LogEntryType.findByEventTypeDescription", query = "SELECT l FROM LogEntryType l WHERE l.eventTypeDescription = :eventTypeDescription") })
@NamedQuery(name = "LogEntryType.findById", query = "SELECT l FROM LogEntryType l WHERE l.id = :id"),
@NamedQuery(name = "LogEntryType.findByDescription", query = "SELECT l FROM LogEntryType l WHERE l.description = :description") })
public class LogEntryType implements ModelInterface {
private static final long serialVersionUID = 1L;
@Id
@Column(name = "event_log_types_id", nullable = false)
private Integer id;
@Column(name = "event_type_description", nullable = false)
private String eventTypeDescription;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "eventLogTypesId")
private List<LogEntry> logEntryList;
private String description;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "type")
private List<LogEntry> logEntries;
@Version
@Column(nullable = false)
private int jpaVersionField;
......@@ -50,23 +52,23 @@ public class LogEntryType implements ModelInterface {
public LogEntryType(Integer eventLogTypesId, String eventTypeDescription) {
this.id = eventLogTypesId;
this.eventTypeDescription = eventTypeDescription;
this.description = eventTypeDescription;
}
public String getEventTypeDescription() {
return eventTypeDescription;
public String getDescription() {
return description;
}
public void setEventTypeDescription(String eventTypeDescription) {
this.eventTypeDescription = eventTypeDescription;
public void setDescription(String eventTypeDescription) {
this.description = eventTypeDescription;
}
public List<LogEntry> getLogEntryList() {
return logEntryList;
public List<LogEntry> getLogEntries() {
return logEntries;
}
public void setLogEntryList(List<LogEntry> logEntryList) {
this.logEntryList = logEntryList;
public void setLogEntries(List<LogEntry> logEntryList) {
this.logEntries = logEntryList;
}
@Override
......@@ -93,8 +95,7 @@ public class LogEntryType implements ModelInterface {
@Override
public String toString() {
return "fi.insomnia.bortal.model.LogEntryType[eventLogTypesId="
+ getId() + "]";
return "fi.insomnia.bortal.model.LogEntryType[id=" + getId() + "]";
}
/**
......
......@@ -26,10 +26,10 @@ import javax.persistence.Version;
@Table(name = "news")
@NamedQueries( {
@NamedQuery(name = "News.findAll", query = "SELECT n FROM News n"),
@NamedQuery(name = "News.findByNewsId", query = "SELECT n FROM News n WHERE n.newsId = :newsId"),
@NamedQuery(name = "News.findById", query = "SELECT n FROM News n WHERE n.id = :id"),
@NamedQuery(name = "News.findByTitle", query = "SELECT n FROM News n WHERE n.title = :title"),
@NamedQuery(name = "News.findByBody", query = "SELECT n FROM News n WHERE n.body = :body"),
@NamedQuery(name = "News.findByAbstract1", query = "SELECT n FROM News n WHERE n.abstract1 = :abstract1"),
@NamedQuery(name = "News.findByAbstract", query = "SELECT n FROM News n WHERE n.bodyAbstract = :bodyAbstract"),
@NamedQuery(name = "News.findByPublish", query = "SELECT n FROM News n WHERE n.publish = :publish"),
@NamedQuery(name = "News.findByExpire", query = "SELECT n FROM News n WHERE n.expire = :expire"),
@NamedQuery(name = "News.findByPriority", query = "SELECT n FROM News n WHERE n.priority = :priority") })
......@@ -42,22 +42,28 @@ public class News implements ModelInterface {
@Column(name = "title", nullable = false)
private String title;
@Column(name = "body")
private String body;
@Column(name = "abstract")
private String abstract1;
private String bodyAbstract;
@Column(name = "publish")
@Temporal(TemporalType.TIMESTAMP)
private Date publish;
@Column(name = "expire")
@Temporal(TemporalType.TIMESTAMP)
private Date expire;
@Column(name = "priority", nullable = false)
private int priority;
@JoinColumn(name = "news_groups_id", referencedColumnName = "news_groups_id", nullable = false)
@ManyToOne(optional = false)
private NewsGroup newsGroupsId;
private NewsGroup group;
@Version
@Column(nullable = false)
private int jpaVersionField;
......@@ -91,12 +97,12 @@ public class News implements ModelInterface {
this.body = body;
}
public String getAbstract1() {
return abstract1;
public String getBodyAbstract() {
return bodyAbstract;
}
public void setAbstract1(String abstract1) {
this.abstract1 = abstract1;
public void setBodyAbstract(String abstract1) {
this.bodyAbstract = abstract1;
}
public Date getPublish() {
......@@ -123,12 +129,12 @@ public class News implements ModelInterface {
this.priority = priority;
}
public NewsGroup getNewsGroupsId() {
return newsGroupsId;
public NewsGroup getGroup() {
return group;
}
public void setNewsGroupsId(NewsGroup newsGroupsId) {
this.newsGroupsId = newsGroupsId;
public void setGroup(NewsGroup newsGroupsId) {
this.group = newsGroupsId;
}
@Override
......@@ -155,7 +161,7 @@ public class News implements ModelInterface {
@Override
public String toString() {
return "fi.insomnia.bortal.model.News[newsId=" + getId() + "]";
return "fi.insomnia.bortal.model.News[id=" + getId() + "]";
}
/**
......
......@@ -26,29 +26,34 @@ import javax.persistence.Version;
@Table(name = "news_groups")
@NamedQueries( {
@NamedQuery(name = "NewsGroup.findAll", query = "SELECT n FROM NewsGroup n"),
@NamedQuery(name = "NewsGroup.findByNewsGroupsId", query = "SELECT n FROM NewsGroup n WHERE n.newsGroupsId = :newsGroupsId"),
@NamedQuery(name = "NewsGroup.findByGroupName", query = "SELECT n FROM NewsGroup n WHERE n.groupName = :groupName"),
@NamedQuery(name = "NewsGroup.findByGroupDescription", query = "SELECT n FROM NewsGroup n WHERE n.groupDescription = :groupDescription"),
@NamedQuery(name = "NewsGroup.findById", query = "SELECT n FROM NewsGroup n WHERE n.id = :id"),
@NamedQuery(name = "NewsGroup.findByName", query = "SELECT n FROM NewsGroup n WHERE n.name = :name"),
@NamedQuery(name = "NewsGroup.findByDescription", query = "SELECT n FROM NewsGroup n WHERE n.description = :description"),
@NamedQuery(name = "NewsGroup.findByPriority", query = "SELECT n FROM NewsGroup n WHERE n.priority = :priority") })
public class NewsGroup implements ModelInterface {
private static final long serialVersionUID = 1L;
@Id
@Column(name = "news_groups_id", nullable = false)
private Integer id;
@Column(name = "group_name", nullable = false)
private String groupName;
private String name;
@Column(name = "group_description")
private String groupDescription;
private String description;
@Column(name = "priority", nullable = false)
private int priority;
@JoinColumn(name = "access_rights_id", referencedColumnName = "access_rights_id", nullable = false)
@ManyToOne(optional = false)
private AccessRight accessRightsId;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "newsGroupsId")
private List<News> newsList;
private AccessRight accessRight;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "group")
private List<News> news;
@Version
@Column(nullable = false)
private int jpaVersionField;
......@@ -62,24 +67,24 @@ public class NewsGroup implements ModelInterface {
public NewsGroup(Integer newsGroupsId, String groupName, int priority) {
this.id = newsGroupsId;
this.groupName = groupName;
this.name = groupName;
this.priority = priority;
}
public String getGroupName() {
return groupName;
public String getName() {
return name;
}
public void setGroupName(String groupName) {
this.groupName = groupName;
public void setName(String groupName) {
this.name = groupName;
}
public String getGroupDescription() {
return groupDescription;
public String getDescription() {
return description;
}
public void setGroupDescription(String groupDescription) {
this.groupDescription = groupDescription;
public void setDescription(String groupDescription) {
this.description = groupDescription;
}
public int getPriority() {
......@@ -90,20 +95,20 @@ public class NewsGroup implements ModelInterface {
this.priority = priority;
}
public AccessRight getAccessRightsId() {
return accessRightsId;
public AccessRight getAccessRight() {
return accessRight;
}
public void setAccessRightsId(AccessRight accessRightsId) {
this.accessRightsId = accessRightsId;
public void setAccessRight(AccessRight accessRightsId) {
this.accessRight = accessRightsId;
}
public List<News> getNewsList() {
return newsList;
public List<News> getNews() {
return news;
}
public void setNewsList(List<News> newsList) {
this.newsList = newsList;
public void setNews(List<News> newsList) {
this.news = newsList;
}
@Override
......
......@@ -17,19 +17,18 @@ import javax.persistence.Version;
/**
*
* @author jkj
*/
@Entity
@Table(name = "places")
@NamedQueries( {
@NamedQuery(name = "Place.findAll", query = "SELECT p FROM Place p"),
@NamedQuery(name = "Place.findByPlacesId", query = "SELECT p FROM Place p WHERE p.placesId = :placesId"),
@NamedQuery(name = "Place.findByPlaceDescription", query = "SELECT p FROM Place p WHERE p.placeDescription = :placeDescription"),
@NamedQuery(name = "Place.findByPlaceName", query = "SELECT p FROM Place p WHERE p.placeName = :placeName"),
@NamedQuery(name = "Place.findByDescription", query = "SELECT p FROM Place p WHERE p.description = :description"),
@NamedQuery(name = "Place.findById", query = "SELECT p FROM Place p WHERE p.id = :id"),
@NamedQuery(name = "Place.findByName", query = "SELECT p FROM Place p WHERE p.name = :name"),
@NamedQuery(name = "Place.findByMapX", query = "SELECT p FROM Place p WHERE p.mapX = :mapX"),
@NamedQuery(name = "Place.findByMapY", query = "SELECT p FROM Place p WHERE p.mapY = :mapY"),
@NamedQuery(name = "Place.findByPlaceDetails", query = "SELECT p FROM Place p WHERE p.placeDetails = :placeDetails"),
@NamedQuery(name = "Place.findByPlaceCode", query = "SELECT p FROM Place p WHERE p.placeCode = :placeCode") })
@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") })
public class Place implements ModelInterface {
private static final long serialVersionUID = 1L;
......@@ -37,33 +36,47 @@ public class Place implements ModelInterface {
@Column(name = "places_id", nullable = false)
private Integer id;
@Column(name = "place_description")
private String placeDescription;
private String description;
@Column(name = "place_name")
private String placeName;
private String name;
@Column(name = "map_x")
private Integer mapX;
@Column(name = "map_y")
private Integer mapY;
@Column(name = "place_details")
private String placeDetails;
private String details;
@Column(name = "place_code")
private String placeCode;
private String code;
@OneToOne(mappedBy = "placeReservation")
private GroupMembership placeReserver;
/**
* Which group has bought the place
*/
@JoinColumn(name = "groups_id", referencedColumnName = "groups_id")
@ManyToOne
private PlaceGroup groupsId;
private PlaceGroup placeGroup;
@JoinColumn(name = "maps_id", referencedColumnName = "maps_id", nullable = false)
@ManyToOne(optional = false)
private EventMap map;
/**
* Which ticket type is this place sold as
*/
@JoinColumn(name = "products_id", referencedColumnName = "products_id", nullable = false)
@ManyToOne(optional = false)
private Product productsId;
private Product product;
/**
* Who is the current currentUser (mapped with code printed on the place) of
* the place. Used in Vectorama currentUser tracking.
*/
@JoinColumn(name = "users_id", referencedColumnName = "users_id")
@ManyToOne
private User usersId;
private User currentUser;
@Version
@Column(nullable = false)
private int jpaVersionField;
......@@ -75,20 +88,20 @@ public class Place implements ModelInterface {
this.id = placesId;
}
public String getPlaceDescription() {
return placeDescription;
public String getDescription() {
return description;
}
public void setPlaceDescription(String placeDescription) {
this.placeDescription = placeDescription;
public void setDescription(String placeDescription) {
this.description = placeDescription;
}
public String getPlaceName() {
return placeName;
public String getName() {
return name;
}
public void setPlaceName(String placeName) {
this.placeName = placeName;
public void setName(String placeName) {
this.name = placeName;
}
public Integer getMapX() {
......@@ -107,28 +120,28 @@ public class Place implements ModelInterface {
this.mapY = mapY;
}
public String getPlaceDetails() {
return placeDetails;
public String getDetails() {
return details;
}
public void setPlaceDetails(String placeDetails) {
this.placeDetails = placeDetails;
public void setDetails(String placeDetails) {
this.details = placeDetails;
}
public String getPlaceCode() {
return placeCode;
public String getCode() {
return code;
}
public void setPlaceCode(String placeCode) {
this.placeCode = placeCode;
public void setCode(String placeCode) {
this.code = placeCode;
}
public PlaceGroup getGroupsId() {
return groupsId;
public PlaceGroup getPlaceGroup() {
return placeGroup;
}
public void setGroupsId(PlaceGroup groupsId) {
this.groupsId = groupsId;
public void setPlaceGroup(PlaceGroup groupsId) {
this.placeGroup = groupsId;
}
public EventMap getMap() {
......@@ -139,20 +152,20 @@ public class Place implements ModelInterface {
this.map = mapsId;
}
public Product getProductsId() {
return productsId;
public Product getProduct() {
return product;
}
public void setProductsId(Product productsId) {
this.productsId = productsId;
public void setProduct(Product productsId) {
this.product = productsId;
}
public User getUsersId() {
return usersId;
public User getCurrentUser() {
return currentUser;
}
public void setUsersId(User usersId) {
this.usersId = usersId;
public void setCurrentUser(User usersId) {
this.currentUser = usersId;
}
@Override
......@@ -179,7 +192,7 @@ public class Place implements ModelInterface {
@Override
public String toString() {
return "fi.insomnia.bortal.model.Place[placesId=" + getId() + "]";
return "fi.insomnia.bortal.model.Place[id=" + getId() + "]";
}
/**
......
......@@ -23,19 +23,18 @@ import javax.persistence.Version;
/**
*
* @author jkj
*/
@Entity
@Table(name = "groups")
@NamedQueries( {
@NamedQuery(name = "PlaceGroup.findAll", query = "SELECT p FROM PlaceGroup p"),
@NamedQuery(name = "PlaceGroup.findByGroupsId", query = "SELECT p FROM PlaceGroup p WHERE p.groupsId = :groupsId"),
@NamedQuery(name = "PlaceGroup.findByGroupCreated", query = "SELECT p FROM PlaceGroup p WHERE p.groupCreated = :groupCreated"),
@NamedQuery(name = "PlaceGroup.findByGroupEdited", query = "SELECT p FROM PlaceGroup p WHERE p.groupEdited = :groupEdited"),
@NamedQuery(name = "PlaceGroup.findByGroupCode", query = "SELECT p FROM PlaceGroup p WHERE p.groupCode = :groupCode"),
@NamedQuery(name = "PlaceGroup.findByGroupName", query = "SELECT p FROM PlaceGroup p WHERE p.groupName = :groupName"),
@NamedQuery(name = "PlaceGroup.findByGroupActive", query = "SELECT p FROM PlaceGroup p WHERE p.groupActive = :groupActive"),
@NamedQuery(name = "PlaceGroup.findByGroupDetails", query = "SELECT p FROM PlaceGroup p WHERE p.groupDetails = :groupDetails") })
@NamedQuery(name = "PlaceGroup.findById", query = "SELECT p FROM PlaceGroup p WHERE p.id = :id"),
@NamedQuery(name = "PlaceGroup.findByCreated", query = "SELECT p FROM PlaceGroup p WHERE p.created = :created"),
@NamedQuery(name = "PlaceGroup.findByEdited", query = "SELECT p FROM PlaceGroup p WHERE p.edited = :edited"),
@NamedQuery(name = "PlaceGroup.findByCode", query = "SELECT p FROM PlaceGroup p WHERE p.code = :code"),
@NamedQuery(name = "PlaceGroup.findByName", query = "SELECT p FROM PlaceGroup p WHERE p.name = :name"),
@NamedQuery(name = "PlaceGroup.findByActive", query = "SELECT p FROM PlaceGroup p WHERE p.active = :active"),
@NamedQuery(name = "PlaceGroup.findByDetails", query = "SELECT p FROM PlaceGroup p WHERE p.details = :details") })
public class PlaceGroup implements ModelInterface {
private static final long serialVersionUID = 1L;
......@@ -45,30 +44,30 @@ public class PlaceGroup implements ModelInterface {
@Column(name = "group_created", nullable = false)
@Temporal(TemporalType.TIMESTAMP)
private Date groupCreated;
private Date created;
@Column(name = "group_edited", nullable = false)
@Temporal(TemporalType.TIMESTAMP)
private Date groupEdited;
private Date edited;
@Column(name = "group_code")
private String groupCode;
private String code;
@Column(name = "group_name")
private String groupName;
private String name;
@Column(name = "group_active", nullable = false)
private boolean groupActive;
private boolean active;
@Column(name = "group_details")
private String groupDetails;
private String details;
@JoinColumn(name = "group_creator", referencedColumnName = "users_id")
@ManyToOne
private User groupCreator;
private User creator;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "groupsId")
private List<GroupMembership> groupMembershipList;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "placeGroup")
private List<GroupMembership> members;
@OneToMany(mappedBy = "placeGroup")
private List<Place> places;
......@@ -87,73 +86,73 @@ public class PlaceGroup implements ModelInterface {
public PlaceGroup(Integer groupsId, Date groupCreated, Date groupEdited,
boolean groupActive) {
this.id = groupsId;
this.groupCreated = groupCreated;
this.groupEdited = groupEdited;
this.groupActive = groupActive;
this.created = groupCreated;
this.edited = groupEdited;
this.active = groupActive;
}
public Date getGroupCreated() {
return groupCreated;
public Date getCreated() {
return created;
}
public void setGroupCreated(Date groupCreated) {
this.groupCreated = groupCreated;
public void setCreated(Date groupCreated) {
this.created = groupCreated;
}
public Date getGroupEdited() {
return groupEdited;
public Date getEdited() {
return edited;
}
public void setGroupEdited(Date groupEdited) {
this.groupEdited = groupEdited;
public void setEdited(Date groupEdited) {
this.edited = groupEdited;
}
public String getGroupCode() {
return groupCode;
public String getCode() {
return code;
}
public void setGroupCode(String groupCode) {
this.groupCode = groupCode;
public void setCode(String groupCode) {
this.code = groupCode;
}
public String getGroupName() {
return groupName;
public String getName() {
return name;
}
public void setGroupName(String groupName) {
this.groupName = groupName;
public void setName(String groupName) {
this.name = groupName;
}
public boolean getGroupActive() {
return groupActive;
public boolean getActive() {
return active;
}
public void setGroupActive(boolean groupActive) {
this.groupActive = groupActive;
public void setActive(boolean groupActive) {
this.active = groupActive;
}
public String getGroupDetails() {
return groupDetails;
public String getDetails() {
return details;
}
public void setGroupDetails(String groupDetails) {
this.groupDetails = groupDetails;
public void setDetails(String groupDetails) {
this.details = groupDetails;
}
public User getGroupCreator() {
return groupCreator;
public User getCreator() {
return creator;
}
public void setGroupCreator(User groupCreator) {
this.groupCreator = groupCreator;
public void setCreator(User groupCreator) {
this.creator = groupCreator;
}
public List<GroupMembership> getGroupMembershipList() {
return groupMembershipList;
public List<GroupMembership> getMembers() {
return members;
}
public void setGroupMembershipList(List<GroupMembership> groupMembershipList) {
this.groupMembershipList = groupMembershipList;
public void setMembers(List<GroupMembership> groupMembershipList) {
this.members = groupMembershipList;
}
public List<Place> getPlaces() {
......@@ -188,7 +187,7 @@ public class PlaceGroup implements ModelInterface {
@Override
public String toString() {
return "fi.insomnia.bortal.model.PlaceGroup[groupsId=" + getId() + "]";
return "fi.insomnia.bortal.model.PlaceGroup[id=" + getId() + "]";
}
/**
......
......@@ -24,17 +24,15 @@ import javax.persistence.Version;
/**
*
* @author jkj
*/
@Entity
@Table(name = "printed_cards")
@NamedQueries( {
@NamedQuery(name = "PrintedCard.findAll", query = "SELECT p FROM PrintedCard p"),
@NamedQuery(name = "PrintedCard.findByPrintedCardsId", query = "SELECT p FROM PrintedCard p WHERE p.printedCardsId = :printedCardsId"),
@NamedQuery(name = "PrintedCard.findByEventRolesTypesId", query = "SELECT p FROM PrintedCard p WHERE p.eventRolesTypesId = :eventRolesTypesId"),
@NamedQuery(name = "PrintedCard.findById", query = "SELECT p FROM PrintedCard p WHERE p.id = :id"),
@NamedQuery(name = "PrintedCard.findByPrintTime", query = "SELECT p FROM PrintedCard p WHERE p.printTime = :printTime"),
@NamedQuery(name = "PrintedCard.findByBarcode", query = "SELECT p FROM PrintedCard p WHERE p.barcode = :barcode"),
@NamedQuery(name = "PrintedCard.findByCardEnabled", query = "SELECT p FROM PrintedCard p WHERE p.cardEnabled = :cardEnabled"),
@NamedQuery(name = "PrintedCard.findByEnabled", query = "SELECT p FROM PrintedCard p WHERE p.enabled = :enabled"),
@NamedQuery(name = "PrintedCard.findByRfidUid", query = "SELECT p FROM PrintedCard p WHERE p.rfidUid = :rfidUid") })
public class PrintedCard implements ModelInterface {
private static final long serialVersionUID = 1L;
......@@ -42,27 +40,33 @@ public class PrintedCard implements ModelInterface {
@Column(name = "printed_cards_id", nullable = false)
private Integer id;
@Column(name = "event_roles_types_id", nullable = false)
private int eventRolesTypesId;
@Column(name = "print_time", nullable = false)
@Temporal(TemporalType.TIMESTAMP)
private Date printTime;
@Column(name = "barcode")
private String barcode;
@Column(name = "card_enabled", nullable = false)
private boolean cardEnabled;
private boolean enabled;
@Column(name = "rfid_uid")
private String rfidUid;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "printedCardsId")
private List<ReaderEvent> readerEventList;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "printedCard")
private List<ReaderEvent> readerEvents;
@JoinColumn(name = "current_location", referencedColumnName = "locations_id")
@ManyToOne
private Location currentLocation;
@JoinColumn(name = "users_id", referencedColumnName = "users_id", nullable = false)
@ManyToOne(optional = false)
private User usersId;
private User user;
@JoinColumn(name = "card_templates_id", referencedColumnName = "card_templates_id", nullable = false)
@ManyToOne(optional = false)
private CardTemplate template;
@Version
@Column(nullable = false)
......@@ -83,20 +87,11 @@ public class PrintedCard implements ModelInterface {
this.id = printedCardsId;
}
public PrintedCard(Integer printedCardsId, int eventRolesTypesId,
Date printTime, boolean cardEnabled) {
public PrintedCard(Integer printedCardsId, Date printTime,
boolean cardEnabled) {
this.id = printedCardsId;
this.eventRolesTypesId = eventRolesTypesId;
this.printTime = printTime;
this.cardEnabled = cardEnabled;
}
public int getEventRolesTypesId() {
return eventRolesTypesId;
}
public void setEventRolesTypesId(int eventRolesTypesId) {
this.eventRolesTypesId = eventRolesTypesId;
this.enabled = cardEnabled;
}
public Date getPrintTime() {
......@@ -115,12 +110,12 @@ public class PrintedCard implements ModelInterface {
this.barcode = barcode;
}
public boolean getCardEnabled() {
return cardEnabled;
public boolean getEnabled() {
return enabled;
}
public void setCardEnabled(boolean cardEnabled) {
this.cardEnabled = cardEnabled;
public void setEnabled(boolean cardEnabled) {
this.enabled = cardEnabled;
}
public String getRfidUid() {
......@@ -131,12 +126,12 @@ public class PrintedCard implements ModelInterface {
this.rfidUid = rfidUid;
}
public List<ReaderEvent> getReaderEventList() {
return readerEventList;
public List<ReaderEvent> getReaderEvents() {
return readerEvents;
}
public void setReaderEventList(List<ReaderEvent> readerEventList) {
this.readerEventList = readerEventList;
public void setReaderEvents(List<ReaderEvent> readerEventList) {
this.readerEvents = readerEventList;
}
public Location getCurrentLocation() {
......@@ -147,12 +142,12 @@ public class PrintedCard implements ModelInterface {
this.currentLocation = currentLocation;
}
public User getUsersId() {
return usersId;
public User getUser() {
return user;
}
public void setUsersId(User usersId) {
this.usersId = usersId;
public void setUser(User usersId) {
this.user = usersId;
}
@Override
......@@ -179,8 +174,7 @@ public class PrintedCard implements ModelInterface {
@Override
public String toString() {
return "fi.insomnia.bortal.model.PrintedCard[printedCardsId=" + id
+ "]";
return "fi.insomnia.bortal.model.PrintedCard[id=" + id + "]";
}
public void setJpaVersionField(int jpaVersionField) {
......@@ -191,4 +185,12 @@ public class PrintedCard implements ModelInterface {
return jpaVersionField;
}
public void setTemplate(CardTemplate template) {
this.template = template;
}
public CardTemplate getTemplate() {
return template;
}
}
......@@ -22,7 +22,6 @@ import javax.persistence.Version;
/**
*
* @author jkj
*/
@Entity
@Table(name = "products")
......@@ -53,11 +52,11 @@ public class Product implements ModelInterface {
@Column(name = "barcode")
private String barcode;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "productsId")
private List<Place> placeList;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "product")
private List<Place> places;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "productsId")
private List<AccountEvent> accountEventList;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "product")
private List<AccountEvent> accountEvents;
@JoinTable(name = "food_wave_templates_products", joinColumns = { @JoinColumn(name = "products_id", referencedColumnName = "products_id") }, inverseJoinColumns = { @JoinColumn(name = "food_wave_templates_id", referencedColumnName = "food_wave_templates_id") })
@ManyToMany
......@@ -115,20 +114,20 @@ public class Product implements ModelInterface {
this.barcode = barcode;
}
public List<Place> getPlaceList() {
return placeList;
public List<Place> getPlaces() {
return places;
}
public void setPlaceList(List<Place> placeList) {
this.placeList = placeList;
public void setPlaces(List<Place> placeList) {
this.places = placeList;
}
public List<AccountEvent> getAccountEventList() {
return accountEventList;
public List<AccountEvent> getAccountEvents() {
return accountEvents;
}
public void setAccountEventList(List<AccountEvent> accountEventList) {
this.accountEventList = accountEventList;
public void setAccountEvents(List<AccountEvent> accountEventList) {
this.accountEvents = accountEventList;
}
@Override
......
......@@ -21,7 +21,6 @@ import javax.persistence.Version;
/**
*
* @author jkj
*/
@Entity
@Table(name = "roles")
......@@ -54,7 +53,7 @@ public class Role implements ModelInterface {
@JoinColumn(name = "card_templates_id", referencedColumnName = "card_templates_id")
@ManyToOne
private CardTemplate cardTemplatesId;
private CardTemplate cardTemplate;
@JoinColumn(name = "events_id", referencedColumnName = "events_id", nullable = false)
@ManyToOne(optional = false)
......@@ -112,12 +111,12 @@ public class Role implements ModelInterface {
this.roleRightList = roleRightList;
}
public CardTemplate getCardTemplatesId() {
return cardTemplatesId;
public CardTemplate getCardTemplate() {
return cardTemplate;
}
public void setCardTemplatesId(CardTemplate cardTemplatesId) {
this.cardTemplatesId = cardTemplatesId;
public void setCardTemplate(CardTemplate cardTemplatesId) {
this.cardTemplate = cardTemplatesId;
}
public Event getEventsId() {
......
......@@ -22,7 +22,6 @@ import javax.persistence.Version;
/**
*
* @author jkj
*/
@Entity
@Table(name = "users")
......@@ -101,16 +100,24 @@ public class User implements ModelInterface {
@OneToMany(mappedBy = "user")
private List<GroupMembership> groupMemberships;
@OneToMany(mappedBy = "usersId")
private List<Place> placeList;
/**
* The places this user has registered into.
*/
@OneToMany(mappedBy = "currentUser")
private List<Place> currentPlaces;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "user")
private List<PrintedCard> printedCardList;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "user")
private List<AccountEvent> accountEventList;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "user")
private List<DiscountInstance> discountInstanceList;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "user")
private List<Bill> billList;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "seller")
private List<AccountEvent> soldItems;
@Version
......@@ -318,12 +325,12 @@ public class User implements ModelInterface {
this.groupMemberships = groupMembershipList;
}
public List<Place> getPlaceList() {
return placeList;
public List<Place> getCurrentPlaces() {
return currentPlaces;
}
public void setPlaceList(List<Place> placeList) {
this.placeList = placeList;
public void setCurrentPlaces(List<Place> placeList) {
this.currentPlaces = placeList;
}
public List<PrintedCard> getPrintedCardList() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!