No effective change - format code

This commit is contained in:
Robin Bygrave
2016-05-18 09:34:20 +12:00
parent 3161664d58
commit a4cb116d4f
98 changed files with 2451 additions and 2467 deletions
@@ -1,7 +1,5 @@
package com.avaje.tests.model.basic;
import java.sql.Timestamp;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
@@ -9,137 +7,138 @@ import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Version;
import javax.validation.constraints.Size;
import java.sql.Timestamp;
/**
* Address entity bean.
*/
@Entity
@Table(name="o_address")
@Table(name = "o_address")
public class Address {
@Id
Short id;
@Size(max=100)
@Column(name="line_1")
String line1;
@Id
Short id;
@Size(max=100)
@Column(name="line_2")
String line2;
@Size(max = 100)
@Column(name = "line_1")
String line1;
@Size(max=100)
String city;
@Size(max = 100)
@Column(name = "line_2")
String line2;
Timestamp cretime;
@Size(max = 100)
String city;
@Version
Timestamp updtime;
Timestamp cretime;
@ManyToOne
Country country;
@Version
Timestamp updtime;
public String toString() {
return id+" "+line1+" "+line2+" "+city+" "+country;
}
@ManyToOne
Country country;
/**
* Return id.
*/
public Short getId() {
return id;
}
/**
* Set id.
*/
public void setId(Short id) {
this.id = id;
}
public String toString() {
return id + " " + line1 + " " + line2 + " " + city + " " + country;
}
/**
* Return line 1.
*/
public String getLine1() {
return line1;
}
/**
* Return id.
*/
public Short getId() {
return id;
}
/**
* Set line 1.
*/
public void setLine1(String line1) {
this.line1 = line1;
}
/**
* Set id.
*/
public void setId(Short id) {
this.id = id;
}
/**
* Return line 2.
*/
public String getLine2() {
return line2;
}
/**
* Return line 1.
*/
public String getLine1() {
return line1;
}
/**
* Set line 2.
*/
public void setLine2(String line2) {
this.line2 = line2;
}
/**
* Set line 1.
*/
public void setLine1(String line1) {
this.line1 = line1;
}
/**
* Return city.
*/
public String getCity() {
return city;
}
/**
* Return line 2.
*/
public String getLine2() {
return line2;
}
/**
* Set city.
*/
public void setCity(String city) {
this.city = city;
}
/**
* Set line 2.
*/
public void setLine2(String line2) {
this.line2 = line2;
}
/**
* Return cretime.
*/
public Timestamp getCretime() {
return cretime;
}
/**
* Return city.
*/
public String getCity() {
return city;
}
/**
* Set cretime.
*/
public void setCretime(Timestamp cretime) {
this.cretime = cretime;
}
/**
* Set city.
*/
public void setCity(String city) {
this.city = city;
}
/**
* Return updtime.
*/
public Timestamp getUpdtime() {
return updtime;
}
/**
* Return cretime.
*/
public Timestamp getCretime() {
return cretime;
}
/**
* Set updtime.
*/
public void setUpdtime(Timestamp updtime) {
this.updtime = updtime;
}
/**
* Set cretime.
*/
public void setCretime(Timestamp cretime) {
this.cretime = cretime;
}
/**
* Return country.
*/
public Country getCountry() {
return country;
}
/**
* Return updtime.
*/
public Timestamp getUpdtime() {
return updtime;
}
/**
* Set country.
*/
public void setCountry(Country country) {
this.country = country;
}
/**
* Set updtime.
*/
public void setUpdtime(Timestamp updtime) {
this.updtime = updtime;
}
/**
* Return country.
*/
public Country getCountry() {
return country;
}
/**
* Set country.
*/
public void setCountry(Country country) {
this.country = country;
}
}
@@ -18,11 +18,11 @@ public abstract class Animal {
@Id
Long id;
@Version
Long version;
@Column(name="species", insertable = false, updatable = false, nullable = false)
@Column(name = "species", insertable = false, updatable = false, nullable = false)
String species;
@ManyToOne
@@ -59,5 +59,5 @@ public abstract class Animal {
public void setShelter(AnimalShelter shelter) {
this.shelter = shelter;
}
}
@@ -1,27 +1,26 @@
package com.avaje.tests.model.basic;
import java.util.List;
import com.avaje.ebean.annotation.PrivateOwned;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Version;
import com.avaje.ebean.annotation.PrivateOwned;
import java.util.List;
@Entity
public class AnimalShelter {
@Id
Long id;
@Version
Long version;
String name;
@OneToMany(cascade=CascadeType.PERSIST, mappedBy="shelter")
@OneToMany(cascade = CascadeType.PERSIST, mappedBy = "shelter")
@PrivateOwned
List<Animal> animals;
@@ -56,5 +55,5 @@ public class AnimalShelter {
public void setAnimals(List<Animal> animals) {
this.animals = animals;
}
}
@@ -11,19 +11,19 @@ import javax.persistence.ManyToOne;
@Inheritance()
@DiscriminatorColumn(name = "option_type", discriminatorType = DiscriminatorType.INTEGER)
@DiscriminatorValue("0")
public class Attribute extends BasicDomain{
private static final long serialVersionUID = 1L;
public class Attribute extends BasicDomain {
@ManyToOne
private AttributeHolder attributeHolder;
private static final long serialVersionUID = 1L;
public AttributeHolder getAttributeHolder() {
return attributeHolder;
}
@ManyToOne
private AttributeHolder attributeHolder;
public AttributeHolder getAttributeHolder() {
return attributeHolder;
}
public void setAttributeHolder(AttributeHolder attributeHolder) {
this.attributeHolder = attributeHolder;
}
public void setAttributeHolder(AttributeHolder attributeHolder) {
this.attributeHolder = attributeHolder;
}
}
@@ -1,29 +1,28 @@
package com.avaje.tests.model.basic;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.OneToMany;
import java.util.Set;
@Entity
public class AttributeHolder extends BasicDomain{
private static final long serialVersionUID = 1L;
public class AttributeHolder extends BasicDomain {
@OneToMany(mappedBy="attributeHolder", cascade={CascadeType.PERSIST})
private Set<Attribute> attributes;// = new HashSet<Attribute>();
private static final long serialVersionUID = 1L;
public Set<Attribute> getAttributes() {
return attributes;
}
@OneToMany(mappedBy = "attributeHolder", cascade = {CascadeType.PERSIST})
private Set<Attribute> attributes;// = new HashSet<Attribute>();
public void setAttributes(Set<Attribute> attributes) {
this.attributes = attributes;
}
public void add(Attribute attribute){
getAttributes().add(attribute);
attribute.setAttributeHolder(this);
}
public Set<Attribute> getAttributes() {
return attributes;
}
public void setAttributes(Set<Attribute> attributes) {
this.attributes = attributes;
}
public void add(Attribute attribute) {
getAttributes().add(attribute);
attribute.setAttributeHolder(this);
}
}
@@ -9,66 +9,62 @@ import javax.persistence.ManyToOne;
/**
* A user may have multiple bookmarks
*
*
* @author Chris
*
*/
@Entity
public class BBookmark {
@Id
@GeneratedValue
private Integer id;
@Id
@GeneratedValue
private Integer id;
@Column
private String bookmarkReference;
@Column
private String bookmarkReference;
@ManyToOne(cascade = CascadeType.PERSIST)
@Column
private BBookmarkUser user;
@ManyToOne(cascade = CascadeType.PERSIST)
@Column
private BBookmarkUser user;
/**
* @return the id
*/
public Integer getId() {
return this.id;
}
/**
* @return the id
*/
public Integer getId() {
return this.id;
}
/**
* @param id
* the id to set
*/
public void setId(final Integer id) {
this.id = id;
}
/**
* @param id the id to set
*/
public void setId(final Integer id) {
this.id = id;
}
/**
* @return the bookmarkReference
*/
public String getBookmarkReference() {
return this.bookmarkReference;
}
/**
* @return the bookmarkReference
*/
public String getBookmarkReference() {
return this.bookmarkReference;
}
/**
* @param bookmarkReference
* the bookmarkReference to set
*/
public void setBookmarkReference(final String bookmarkReference) {
this.bookmarkReference = bookmarkReference;
}
/**
* @param bookmarkReference the bookmarkReference to set
*/
public void setBookmarkReference(final String bookmarkReference) {
this.bookmarkReference = bookmarkReference;
}
/**
* @return the user
*/
public BBookmarkUser getUser() {
return this.user;
}
/**
* @return the user
*/
public BBookmarkUser getUser() {
return this.user;
}
/**
* @param user
* the user to set
*/
public void setUser(final BBookmarkUser user) {
this.user = user;
}
/**
* @param user the user to set
*/
public void setUser(final BBookmarkUser user) {
this.user = user;
}
}
@@ -7,106 +7,100 @@ import javax.persistence.Id;
/**
* represents a user entity. A user contains a username and password.
*
*
* @author Chris
*
*/
@Entity
public class BBookmarkUser {
@Id
@GeneratedValue
private Integer id;
@Id
@GeneratedValue
private Integer id;
@Column
private String name;
@Column
private String name;
@Column
private String password;
@Column
private String password;
@Column
private String emailAddress;
@Column
private String emailAddress;
@Column
private String country;
@Column
private String country;
// @Version
// private Timestamp lastUpdate;
/**
* @return the id
*/
public Integer getId() {
return this.id;
}
/**
* @param id
* the id to set
*/
public void setId(final Integer id) {
this.id = id;
}
/**
* @return the id
*/
public Integer getId() {
return this.id;
}
/**
* @return the password
*/
public String getPassword() {
return this.password;
}
/**
* @param id the id to set
*/
public void setId(final Integer id) {
this.id = id;
}
/**
* @param password
* the password to set
*/
public void setPassword(final String password) {
this.password = password;
}
/**
* @return the password
*/
public String getPassword() {
return this.password;
}
/**
* @return the name
*/
public String getName() {
return this.name;
}
/**
* @param password the password to set
*/
public void setPassword(final String password) {
this.password = password;
}
/**
* @param name
* the name to set
*/
public void setName(final String name) {
this.name = name;
}
/**
* @return the name
*/
public String getName() {
return this.name;
}
/**
* @return the emailAddress
*/
public String getEmailAddress() {
return this.emailAddress;
}
/**
* @param name the name to set
*/
public void setName(final String name) {
this.name = name;
}
/**
* @param emailAddress
* the emailAddress to set
*/
public void setEmailAddress(final String emailAddress) {
this.emailAddress = emailAddress;
}
/**
* @return the emailAddress
*/
public String getEmailAddress() {
return this.emailAddress;
}
/**
* @return the country
*/
public String getCountry() {
return this.country;
}
/**
* @param emailAddress the emailAddress to set
*/
public void setEmailAddress(final String emailAddress) {
this.emailAddress = emailAddress;
}
/**
* @param country
* the country to set
*/
public void setCountry(final String country) {
this.country = country;
}
/**
* @return the country
*/
public String getCountry() {
return this.country;
}
/**
* @param country the country to set
*/
public void setCountry(final String country) {
this.country = country;
}
// public Timestamp getLastUpdate() {
// return lastUpdate;
@@ -115,5 +109,5 @@ public class BBookmarkUser {
// public void setLastUpdate(Timestamp lastUpdate) {
// this.lastUpdate = lastUpdate;
// }
}
@@ -1,21 +1,20 @@
package com.avaje.tests.model.basic;
import java.sql.Timestamp;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Version;
import java.sql.Timestamp;
@Entity
public class BWithQIdent {
@Id
Integer id;
@Column(name="`Name`", unique=true)
@Column(name = "`Name`", unique = true)
String name;
@Version
Timestamp lastUpdated;
@@ -42,5 +41,5 @@ public class BWithQIdent {
public void setLastUpdated(Timestamp lastUpdated) {
this.lastUpdated = lastUpdated;
}
}
@@ -1,61 +1,60 @@
package com.avaje.tests.model.basic;
import java.io.Serializable;
import java.sql.Timestamp;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import javax.persistence.Version;
import com.avaje.ebean.annotation.WhenCreated;
import com.avaje.ebean.annotation.WhenModified;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import javax.persistence.Version;
import java.io.Serializable;
import java.sql.Timestamp;
@MappedSuperclass
public class BasicDomain implements Serializable {
private static final long serialVersionUID = 5569496199004449769L;
private static final long serialVersionUID = 5569496199004449769L;
@Id
Integer id;
@Id
Integer id;
@WhenCreated
Timestamp cretime;
@WhenModified
Timestamp updtime;
@WhenCreated
Timestamp cretime;
@Version
Long version;
@WhenModified
Timestamp updtime;
public Integer getId() {
return id;
}
@Version
Long version;
public void setId(Integer id) {
this.id = id;
}
public Integer getId() {
return id;
}
public Timestamp getUpdtime() {
return updtime;
}
public void setId(Integer id) {
this.id = id;
}
public void setUpdtime(Timestamp updtime) {
this.updtime = updtime;
}
public Timestamp getUpdtime() {
return updtime;
}
public Timestamp getCretime() {
return cretime;
}
public void setUpdtime(Timestamp updtime) {
this.updtime = updtime;
}
public void setCretime(Timestamp cretime) {
this.cretime = cretime;
}
public Timestamp getCretime() {
return cretime;
}
public Long getVersion() {
return version;
}
public void setCretime(Timestamp cretime) {
this.cretime = cretime;
}
public void setVersion(Long version) {
this.version = version;
}
public Long getVersion() {
return version;
}
public void setVersion(Long version) {
this.version = version;
}
}
@@ -1,18 +1,17 @@
package com.avaje.tests.model.basic;
import java.util.TimeZone;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.util.TimeZone;
@Entity
public class BeanWithTimeZone {
@Id
@Id
Long id;
String name;
TimeZone timezone;
public Long getId() {
@@ -38,5 +37,5 @@ public class BeanWithTimeZone {
public void setTimezone(TimeZone timezone) {
this.timezone = timezone;
}
}
@@ -4,27 +4,27 @@ import javax.persistence.Entity;
import javax.persistence.Id;
@Entity
public class CKeyAssoc {
public class CKeyAssoc {
@Id
Integer id;
String assocOne;
@Id
Integer id;
public Integer getId() {
return id;
}
String assocOne;
public void setId(Integer id) {
this.id = id;
}
public Integer getId() {
return id;
}
public String getAssocOne() {
return assocOne;
}
public void setId(Integer id) {
this.id = id;
}
public String getAssocOne() {
return assocOne;
}
public void setAssocOne(String assocOne) {
this.assocOne = assocOne;
}
public void setAssocOne(String assocOne) {
this.assocOne = assocOne;
}
}
@@ -7,48 +7,49 @@ import javax.persistence.ManyToOne;
@Entity
public class CKeyDetail {
@Id
Integer id;
String something;
@ManyToOne
@Id
Integer id;
String something;
@ManyToOne
// @JoinColumns({
// @JoinColumn(name="parent_one_key", referencedColumnName="one_key"),
// @JoinColumn(name="parent_two_key", referencedColumnName="two_key")
// })
CKeyParent parent;
CKeyParent parent;
public CKeyDetail(){
}
public CKeyDetail(String something){
this.something = something;
}
public Integer getId() {
return id;
}
public CKeyDetail() {
public void setId(Integer id) {
this.id = id;
}
}
public String getSomething() {
return something;
}
public CKeyDetail(String something) {
this.something = something;
}
public void setSomething(String something) {
this.something = something;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getSomething() {
return something;
}
public void setSomething(String something) {
this.something = something;
}
public CKeyParent getParent() {
return parent;
}
public void setParent(CKeyParent parent) {
this.parent = parent;
}
public CKeyParent getParent() {
return parent;
}
public void setParent(CKeyParent parent) {
this.parent = parent;
}
}
@@ -1,77 +1,76 @@
package com.avaje.tests.model.basic;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Version;
import java.util.ArrayList;
import java.util.List;
@Entity
public class CKeyParent {
@EmbeddedId
CKeyParentId id;
String name;
@Version
int version;
@EmbeddedId
CKeyParentId id;
@ManyToOne(cascade=CascadeType.PERSIST)
CKeyAssoc assoc;
@OneToMany(cascade=CascadeType.PERSIST, mappedBy="parent")
List<CKeyDetail> details;
public CKeyParentId getId() {
return id;
}
String name;
public void setId(CKeyParentId id) {
this.id = id;
}
@Version
int version;
public String getName() {
return name;
}
@ManyToOne(cascade = CascadeType.PERSIST)
CKeyAssoc assoc;
public void setName(String name) {
this.name = name;
}
@OneToMany(cascade = CascadeType.PERSIST, mappedBy = "parent")
List<CKeyDetail> details;
public int getVersion() {
return version;
}
public CKeyParentId getId() {
return id;
}
public void setVersion(int version) {
this.version = version;
}
public void setId(CKeyParentId id) {
this.id = id;
}
public CKeyAssoc getAssoc() {
return assoc;
}
public String getName() {
return name;
}
public void setAssoc(CKeyAssoc assoc) {
this.assoc = assoc;
}
public void setName(String name) {
this.name = name;
}
public List<CKeyDetail> getDetails() {
return details;
}
public int getVersion() {
return version;
}
public void setVersion(int version) {
this.version = version;
}
public CKeyAssoc getAssoc() {
return assoc;
}
public void setAssoc(CKeyAssoc assoc) {
this.assoc = assoc;
}
public List<CKeyDetail> getDetails() {
return details;
}
public void setDetails(List<CKeyDetail> details) {
this.details = details;
}
public void add(CKeyDetail detail) {
if (details == null) {
details = new ArrayList<CKeyDetail>();
}
details.add(detail);
}
public void setDetails(List<CKeyDetail> details) {
this.details = details;
}
public void add(CKeyDetail detail) {
if (details == null){
details = new ArrayList<CKeyDetail>();
}
details.add(detail);
}
}
@@ -5,48 +5,52 @@ import javax.persistence.Embeddable;
@Embeddable
public class CKeyParentId {
Integer oneKey;
String twoKey;
public CKeyParentId() {
}
public CKeyParentId(Integer oneKey, String twoKey){
this.oneKey = oneKey;
this.twoKey = twoKey;
}
public Integer getOneKey() {
return oneKey;
}
public void setOneKey(Integer oneKey) {
this.oneKey = oneKey;
}
public String getTwoKey() {
return twoKey;
}
public void setTwoKey(String twoKey) {
this.twoKey = twoKey;
}
Integer oneKey;
String twoKey;
@Override
public boolean equals(Object o) {
if (this == o){
return true;
}
if (!(o instanceof CKeyParentId)){
return false;
}
public CKeyParentId() {
CKeyParentId otherKey = (CKeyParentId) o;
return otherKey.hashCode() == hashCode();
}
public CKeyParentId(Integer oneKey, String twoKey) {
this.oneKey = oneKey;
this.twoKey = twoKey;
}
public Integer getOneKey() {
return oneKey;
}
public void setOneKey(Integer oneKey) {
this.oneKey = oneKey;
}
public String getTwoKey() {
return twoKey;
}
public void setTwoKey(String twoKey) {
this.twoKey = twoKey;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof CKeyParentId)) {
return false;
}
@Override
public int hashCode(){
int hc = getClass().getName().hashCode();
hc = 31 * hc + oneKey;
hc = 31 * hc + twoKey.hashCode();
return hc;
}
CKeyParentId otherKey = (CKeyParentId) o;
return otherKey.hashCode() == hashCode();
}
@Override
public int hashCode() {
int hc = getClass().getName().hashCode();
hc = 31 * hc + oneKey;
hc = 31 * hc + twoKey.hashCode();
return hc;
}
}
@@ -6,9 +6,9 @@ import javax.persistence.Entity;
@Entity
@DiscriminatorValue("CAT")
public class Cat extends Animal {
String name;
public String getName() {
return name;
}
@@ -16,5 +16,5 @@ public class Cat extends Animal {
public void setName(String name) {
this.name = name;
}
}
@@ -5,16 +5,16 @@ import javax.persistence.Entity;
@Entity
public class ContactGroup extends BasicDomain {
private static final long serialVersionUID = -5447111032760796085L;
private static final long serialVersionUID = -5447111032760796085L;
String name;
String name;
public String getName() {
return name;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public void setName(String name) {
this.name = name;
}
}
@@ -7,43 +7,43 @@ import javax.persistence.ManyToOne;
@Entity
public class ContactNote extends BasicDomain {
private static final long serialVersionUID = 7949702621226333278L;
private static final long serialVersionUID = 7949702621226333278L;
@ManyToOne
Contact contact;
String title;
@Lob
String note;
@ManyToOne
Contact contact;
public ContactNote(String title, String note) {
this.title = title;
this.note = note;
}
String title;
public String getTitle() {
return title;
}
@Lob
String note;
public void setTitle(String title) {
this.title = title;
}
public ContactNote(String title, String note) {
this.title = title;
this.note = note;
}
public String getNote() {
return note;
}
public String getTitle() {
return title;
}
public void setNote(String note) {
this.note = note;
}
public void setTitle(String title) {
this.title = title;
}
public Contact getContact() {
return contact;
}
public String getNote() {
return note;
}
public void setNote(String note) {
this.note = note;
}
public Contact getContact() {
return contact;
}
public void setContact(Contact contact) {
this.contact = contact;
}
public void setContact(Contact contact) {
this.contact = contact;
}
}
@@ -24,44 +24,44 @@ import javax.validation.constraints.Size;
@Table(name = "o_country")
public class Country {
@Id
@Size(max=2)
String code;
@Id
@Size(max = 2)
String code;
@Size(max=60)
String name;
public String toString() {
return code;
}
/**
* Return code.
*/
public String getCode() {
return code;
}
@Size(max = 60)
String name;
/**
* Set code.
*/
public void setCode(String code) {
this.code = code;
}
public String toString() {
return code;
}
/**
* Return name.
*/
public String getName() {
return name;
}
/**
* Return code.
*/
public String getCode() {
return code;
}
/**
* Set name.
*/
public void setName(String name) {
this.name = name;
}
/**
* Set code.
*/
public void setCode(String code) {
this.code = code;
}
/**
* Return name.
*/
public String getName() {
return name;
}
/**
* Set name.
*/
public void setName(String name) {
this.name = name;
}
}
@@ -29,7 +29,7 @@ import java.util.concurrent.locks.ReentrantLock;
*/
@Cache(enableQueryCache = true)
@DocStore
@ChangeLog(inserts = ChangeLogInsertMode.EXCLUDE, updatesThatInclude = {"name","status"})
@ChangeLog(inserts = ChangeLogInsertMode.EXCLUDE, updatesThatInclude = {"name", "status"})
@Entity
@Table(name = "o_customer")
@DbComment("Holds external customers")
@@ -48,6 +48,7 @@ public class Customer extends BasicDomain {
INACTIVE("I");
String dbValue;
Status(String dbValue) {
this.dbValue = dbValue;
}
@@ -79,14 +80,14 @@ public class Customer extends BasicDomain {
String smallnote;
@DbComment("Join date of the customer")
@NotNull(groups = { ValidationGroupSomething.class })
@NotNull(groups = {ValidationGroupSomething.class})
Date anniversary;
@DocEmbedded(doc="*,country(*)")
@DocEmbedded(doc = "*,country(*)")
@ManyToOne(cascade = CascadeType.ALL)
Address billingAddress;
@DocEmbedded(doc="*,country(*)")
@DocEmbedded(doc = "*,country(*)")
@ManyToOne(cascade = CascadeType.ALL)
Address shippingAddress;
@@ -1,10 +1,10 @@
package com.avaje.tests.model.basic;
import com.avaje.ebean.annotation.Sql;
import javax.persistence.Entity;
import javax.persistence.OneToOne;
import com.avaje.ebean.annotation.Sql;
/**
* An example of an Aggregate object.
* <p>
@@ -16,33 +16,33 @@ import com.avaje.ebean.annotation.Sql;
@Sql
public class CustomerAggregate {
@OneToOne
Customer customer;
@OneToOne
Customer customer;
int totalContacts;
int totalContacts;
public String toString() {
return customer.getId() + " totalContacts:" + totalContacts;
}
public String toString() {
return customer.getId() + " totalContacts:" + totalContacts;
}
public Customer getCustomer() {
return customer;
}
public Customer getCustomer() {
return customer;
}
public void setCustomer(Customer customer) {
this.customer = customer;
}
public void setCustomer(Customer customer) {
this.customer = customer;
}
public int getTotalContacts() {
return totalContacts;
}
public int getTotalContacts() {
return totalContacts;
}
public void setTotalContacts(int totalContacts) {
this.totalContacts = totalContacts;
}
public void setTotalContacts(int totalContacts) {
this.totalContacts = totalContacts;
}
}
@@ -1,16 +1,15 @@
package com.avaje.tests.model.basic;
import java.sql.Date;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import java.sql.Date;
@Entity
@DiscriminatorValue("DOG")
public class Dog extends Animal {
String registrationNumber;
Date dateOfBirth;
public String getRegistrationNumber() {
@@ -28,5 +27,5 @@ public class Dog extends Animal {
public void setDateOfBirth(Date dateOfBirth) {
this.dateOfBirth = dateOfBirth;
}
}
@@ -1,13 +1,12 @@
package com.avaje.tests.model.basic;
import java.sql.Timestamp;
import com.avaje.ebean.annotation.EnumValue;
import com.avaje.ebean.annotation.Index;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import com.avaje.ebean.annotation.EnumValue;
import com.avaje.ebean.annotation.Index;
import java.sql.Timestamp;
@Entity
@Table(name = "e_basic")
@@ -16,7 +16,7 @@ import java.sql.Timestamp;
@Cache(enableQueryCache = true)
@ReadAudit
@ChangeLog(updatesThatInclude = {"name","shortDescription"})
@ChangeLog(updatesThatInclude = {"name", "shortDescription"})
@Entity
public class EBasicChangeLog {
@@ -1,67 +1,66 @@
package com.avaje.tests.model.basic;
import java.sql.Timestamp;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.Version;
import java.sql.Timestamp;
@Entity
public class EBasicClob {
@Id
private Long id;
@Id
private Long id;
private String name;
private String title;
private String name;
@Lob
private String description;
@Version
private Timestamp lastUpdate;
private String title;
public void setId(Long id) {
this.id = id;
}
@Lob
private String description;
public Long getId() {
return id;
}
@Version
private Timestamp lastUpdate;
public void setName(String name) {
this.name = name;
}
public String getName() {
return name;
}
public void setId(Long id) {
this.id = id;
}
public void setDescription(String description) {
this.description = description;
}
public Long getId() {
return id;
}
public String getDescription() {
return description;
}
public void setName(String name) {
this.name = name;
}
public String getTitle() {
return title;
}
public String getName() {
return name;
}
public void setTitle(String title) {
this.title = title;
}
public void setDescription(String description) {
this.description = description;
}
public Timestamp getLastUpdate() {
return lastUpdate;
}
public String getDescription() {
return description;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public Timestamp getLastUpdate() {
return lastUpdate;
}
public void setLastUpdate(Timestamp lastUpdate) {
this.lastUpdate = lastUpdate;
}
public void setLastUpdate(Timestamp lastUpdate) {
this.lastUpdate = lastUpdate;
}
}
@@ -1,13 +1,12 @@
package com.avaje.tests.model.basic;
import java.sql.Timestamp;
import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.Version;
import java.sql.Timestamp;
@Entity
public class EBasicClobFetchEager {
@@ -7,38 +7,38 @@ import javax.persistence.Lob;
@Entity
public class EBasicClobNoVer {
@Id
private Long id;
@Id
private Long id;
private String name;
private String name;
/**
* Note that lobs default to FetchType.LAZY - see EBasicClobFetchEager.
*/
@Lob
private String description;
/**
* Note that lobs default to FetchType.LAZY - see EBasicClobFetchEager.
*/
@Lob
private String description;
public void setId(Long id) {
this.id = id;
}
public void setId(Long id) {
this.id = id;
}
public Long getId() {
return id;
}
public Long getId() {
return id;
}
public void setName(String name) {
this.name = name;
}
public void setName(String name) {
this.name = name;
}
public String getName() {
return name;
}
public String getName() {
return name;
}
public void setDescription(String description) {
this.description = description;
}
public void setDescription(String description) {
this.description = description;
}
public String getDescription() {
return description;
}
public String getDescription() {
return description;
}
}
@@ -1,71 +1,70 @@
package com.avaje.tests.model.basic;
import java.sql.Date;
import java.sql.Timestamp;
import com.avaje.ebean.annotation.Encrypted;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import com.avaje.ebean.annotation.Encrypted;
import java.sql.Date;
import java.sql.Timestamp;
@Entity
@Table(name="e_basicenc")
@Table(name = "e_basicenc")
public class EBasicEncrypt {
@Id
Integer id;
String name;
//@Lob
@Encrypted(dbLength=80)
String description;
@Encrypted(dbLength=20)
Date dob;
//@Version
Timestamp lastUpdate;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
@Id
Integer id;
public String getName() {
return name;
}
String name;
public void setName(String name) {
this.name = name;
}
//@Lob
@Encrypted(dbLength = 80)
String description;
public Date getDob() {
return dob;
}
@Encrypted(dbLength = 20)
Date dob;
public void setDob(Date dob) {
this.dob = dob;
}
//@Version
Timestamp lastUpdate;
public String getDescription() {
return description;
}
public Integer getId() {
return id;
}
public void setDescription(String description) {
this.description = description;
}
public void setId(Integer id) {
this.id = id;
}
public Timestamp getLastUpdate() {
return lastUpdate;
}
public String getName() {
return name;
}
public void setLastUpdate(Timestamp lastUpdate) {
this.lastUpdate = lastUpdate;
}
public void setName(String name) {
this.name = name;
}
public Date getDob() {
return dob;
}
public void setDob(Date dob) {
this.dob = dob;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Timestamp getLastUpdate() {
return lastUpdate;
}
public void setLastUpdate(Timestamp lastUpdate) {
this.lastUpdate = lastUpdate;
}
}
@@ -1,81 +1,80 @@
package com.avaje.tests.model.basic;
import java.sql.Timestamp;
import com.avaje.ebean.annotation.Encrypted;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.Table;
import javax.persistence.Version;
import com.avaje.ebean.annotation.Encrypted;
import java.sql.Timestamp;
@Entity
@Table(name="e_basicenc_bin")
@Table(name = "e_basicenc_bin")
public class EBasicEncryptBinary {
@Id
Integer id;
String name;
String description;
@Encrypted
@Lob
byte[] data;
@Encrypted
Timestamp someTime;
@Version
Timestamp lastUpdate;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
@Id
Integer id;
public String getName() {
return name;
}
String name;
public void setName(String name) {
this.name = name;
}
String description;
public String getDescription() {
return description;
}
@Encrypted
@Lob
byte[] data;
public void setDescription(String description) {
this.description = description;
}
@Encrypted
Timestamp someTime;
public byte[] getData() {
return data;
}
@Version
Timestamp lastUpdate;
public void setData(byte[] data) {
this.data = data;
}
public Integer getId() {
return id;
}
public Timestamp getLastUpdate() {
return lastUpdate;
}
public void setId(Integer id) {
this.id = id;
}
public void setLastUpdate(Timestamp lastUpdate) {
this.lastUpdate = lastUpdate;
}
public String getName() {
return name;
}
public Timestamp getSomeTime() {
return someTime;
}
public void setName(String name) {
this.name = name;
}
public void setSomeTime(Timestamp someTime) {
this.someTime = someTime;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public byte[] getData() {
return data;
}
public void setData(byte[] data) {
this.data = data;
}
public Timestamp getLastUpdate() {
return lastUpdate;
}
public void setLastUpdate(Timestamp lastUpdate) {
this.lastUpdate = lastUpdate;
}
public Timestamp getSomeTime() {
return someTime;
}
public void setSomeTime(Timestamp someTime) {
this.someTime = someTime;
}
}
@@ -1,54 +1,54 @@
package com.avaje.tests.model.basic;
import com.avaje.ebean.annotation.EnumValue;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import com.avaje.ebean.annotation.EnumValue;
@Entity
@Table(name="e_basic_enum_id")
@Table(name = "e_basic_enum_id")
public class EBasicEnumId {
public enum Status {
@EnumValue("N")
NEW,
@EnumValue("A")
ACTIVE,
@EnumValue("I")
INACTIVE,
}
@Id
Status status;
String name;
public enum Status {
@EnumValue("N")
NEW,
String description;
@EnumValue("A")
ACTIVE,
public Status getStatus() {
return status;
}
@EnumValue("I")
INACTIVE,
}
public void setStatus(Status status) {
this.status = status;
}
@Id
Status status;
public String getName() {
return name;
}
String name;
public void setName(String name) {
this.name = name;
}
String description;
public String getDescription() {
return description;
}
public Status getStatus() {
return status;
}
public void setDescription(String description) {
this.description = description;
}
public void setStatus(Status status) {
this.status = status;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
}
@@ -18,9 +18,11 @@ public class EBasicEnumInt {
INACTIVE("3");
String value;
Status(String value) {
this.value = value;
}
@DbEnumValue(storage = DbEnumType.INTEGER)
public String getValue() {
return value;
@@ -8,33 +8,33 @@ import javax.persistence.Table;
@Table(name = "e_basic_ndc")
public class EBasicNoDefaultConstructor {
@Id
Integer id;
@Id
Integer id;
String name;
String name;
public EBasicNoDefaultConstructor() {
}
public EBasicNoDefaultConstructor(Integer id, String name) {
this.id = id;
this.name = name;
}
public EBasicNoDefaultConstructor() {
}
public Integer getId() {
return id;
}
public EBasicNoDefaultConstructor(Integer id, String name) {
this.id = id;
this.name = name;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getId() {
return id;
}
public String getName() {
return name;
}
public void setId(Integer id) {
this.id = id;
}
public void setName(String name) {
this.name = name;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
@@ -2,12 +2,11 @@ package com.avaje.tests.model.basic;
import com.avaje.ebean.annotation.Cache;
import java.sql.Timestamp;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Version;
import java.sql.Timestamp;
@Cache(enableQueryCache = true)
@Entity
@@ -13,29 +13,29 @@ import javax.persistence.Table;
import javax.persistence.Version;
@Entity
@Table(name="e_basic_withlife")
@Table(name = "e_basic_withlife")
public class EBasicWithLifecycle {
@Id
Long id;
String name;
@Version
Long version;
transient StringBuilder buffer = new StringBuilder();
@PrePersist
public void prePersist1() {
buffer.append("prePersist1");
}
@PrePersist
public void prePersist2() {
buffer.append("prePersist2");
}
@PostPersist
public void postPersist1() {
buffer.append("postPersist1");
@@ -45,7 +45,7 @@ public class EBasicWithLifecycle {
public void postPersist2() {
buffer.append("postPersist2");
}
@PreUpdate
public void preUpdate1() {
buffer.append("preUpdate1");
@@ -55,7 +55,7 @@ public class EBasicWithLifecycle {
public void preUpdate2() {
buffer.append("preUpdate2");
}
@PostUpdate
public void postUpdate1() {
buffer.append("postUpdate1");
@@ -65,7 +65,7 @@ public class EBasicWithLifecycle {
public void postUpdate2() {
buffer.append("postUpdate2");
}
@PreRemove
public void preRemove1() {
buffer.append("preRemove1");
@@ -75,7 +75,7 @@ public class EBasicWithLifecycle {
public void preRemove2() {
buffer.append("preRemove2");
}
@PostRemove
public void postRemove1() {
buffer.append("postRemove1");
@@ -85,7 +85,7 @@ public class EBasicWithLifecycle {
public void postRemove2() {
buffer.append("postRemove2");
}
@PostLoad
public void postLoad1() {
buffer.append("postLoad1");
@@ -123,5 +123,5 @@ public class EBasicWithLifecycle {
public String getBuffer() {
return buffer.toString();
}
}
@@ -1,78 +1,77 @@
package com.avaje.tests.model.basic;
import java.sql.Timestamp;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import javax.persistence.Version;
import java.sql.Timestamp;
@Entity
@Table(name="e_basicverucon")
@UniqueConstraint(columnNames={"other","other_one"})
@Table(name = "e_basicverucon")
@UniqueConstraint(columnNames = {"other", "other_one"})
public class EBasicWithUniqueCon {
@Id
Integer id;
@Column(unique=true)
String name;
String other;
String otherOne;
String description;
@Version
Timestamp lastUpdate;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
@Id
Integer id;
public String getName() {
return name;
}
@Column(unique = true)
String name;
public void setName(String name) {
this.name = name;
}
String other;
String otherOne;
String description;
public String getOther() {
return other;
}
@Version
Timestamp lastUpdate;
public void setOther(String other) {
this.other = other;
}
public String getOtherOne() {
return otherOne;
}
public Integer getId() {
return id;
}
public void setOtherOne(String otherOne) {
this.otherOne = otherOne;
}
public void setId(Integer id) {
this.id = id;
}
public String getDescription() {
return description;
}
public String getName() {
return name;
}
public void setDescription(String description) {
this.description = description;
}
public void setName(String name) {
this.name = name;
}
public Timestamp getLastUpdate() {
return lastUpdate;
}
public String getOther() {
return other;
}
public void setLastUpdate(Timestamp lastUpdate) {
this.lastUpdate = lastUpdate;
}
public void setOther(String other) {
this.other = other;
}
public String getOtherOne() {
return otherOne;
}
public void setOtherOne(String otherOne) {
this.otherOne = otherOne;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Timestamp getLastUpdate() {
return lastUpdate;
}
public void setLastUpdate(Timestamp lastUpdate) {
this.lastUpdate = lastUpdate;
}
}
@@ -7,7 +7,8 @@ import javax.persistence.Id;
@Entity
public class ECustomId {
@Id @GeneratedValue(generator = "shortUid")
@Id
@GeneratedValue(generator = "shortUid")
String id;
String name;
@@ -1,11 +1,10 @@
package com.avaje.tests.model.basic;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import java.util.List;
@Entity
public class ENullCollection {
@@ -6,28 +6,28 @@ import javax.persistence.Id;
@Entity
public class ENullCollectionDetail {
@Id
Integer id;
String something;
public ENullCollectionDetail() {
}
@Id
Integer id;
public Integer getId() {
return id;
}
String something;
public void setId(Integer id) {
this.id = id;
}
public ENullCollectionDetail() {
}
public String getSomething() {
return something;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getSomething() {
return something;
}
public void setSomething(String something) {
this.something = something;
}
public void setSomething(String something) {
this.something = something;
}
}
@@ -6,28 +6,28 @@ import javax.persistence.ManyToOne;
@Entity
public class EOptOneA extends BasicDomain {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
String nameForA;
@ManyToOne(optional=true)
EOptOneB b;
public String getNameForA() {
return nameForA;
}
String nameForA;
public void setNameForA(String nameForA) {
this.nameForA = nameForA;
}
@ManyToOne(optional = true)
EOptOneB b;
public String getNameForA() {
return nameForA;
}
public void setNameForA(String nameForA) {
this.nameForA = nameForA;
}
public EOptOneB getB() {
return b;
}
public void setB(EOptOneB b) {
this.b = b;
}
public EOptOneB getB() {
return b;
}
public void setB(EOptOneB b) {
this.b = b;
}
}
@@ -6,27 +6,27 @@ import javax.persistence.ManyToOne;
@Entity
public class EOptOneB extends BasicDomain {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
String nameForB;
String nameForB;
@ManyToOne(optional=false)
EOptOneC c;
public String getNameForB() {
return nameForB;
}
@ManyToOne(optional = false)
EOptOneC c;
public void setNameForB(String nameForA) {
this.nameForB = nameForA;
}
public String getNameForB() {
return nameForB;
}
public EOptOneC getC() {
return c;
}
public void setNameForB(String nameForA) {
this.nameForB = nameForA;
}
public EOptOneC getC() {
return c;
}
public void setC(EOptOneC c) {
this.c = c;
}
public void setC(EOptOneC c) {
this.c = c;
}
}
@@ -5,16 +5,16 @@ import javax.persistence.Entity;
@Entity
public class EOptOneC extends BasicDomain {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
String nameForC;
String nameForC;
public String getNameForC() {
return nameForC;
}
public String getNameForC() {
return nameForC;
}
public void setNameForC(String nameForA) {
this.nameForC = nameForA;
}
public void setNameForC(String nameForA) {
this.nameForC = nameForA;
}
}
@@ -9,28 +9,28 @@ import javax.persistence.Id;
@Entity
public class ESimple {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "usertypeid", unique = true, nullable = false)
private Integer id;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "usertypeid", unique = true, nullable = false)
private Integer id;
private String name;
private String name;
public Integer getId() {
return id;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
@@ -1,58 +1,57 @@
package com.avaje.tests.model.basic;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.util.Currency;
import java.util.Locale;
import java.util.TimeZone;
import javax.persistence.Entity;
import javax.persistence.Id;
@Entity
public class ESomeType {
@Id
Integer id;
Currency currency;
Locale locale;
TimeZone timeZone;
@Id
Integer id;
public String toString() {
return id+" "+locale+" "+currency+" "+timeZone;
}
public Integer getId() {
return id;
}
Currency currency;
public void setId(Integer id) {
this.id = id;
}
Locale locale;
public Currency getCurrency() {
return currency;
}
TimeZone timeZone;
public void setCurrency(Currency currency) {
this.currency = currency;
}
public String toString() {
return id + " " + locale + " " + currency + " " + timeZone;
}
public Locale getLocale() {
return locale;
}
public Integer getId() {
return id;
}
public void setLocale(Locale locale) {
this.locale = locale;
}
public void setId(Integer id) {
this.id = id;
}
public TimeZone getTimeZone() {
return timeZone;
}
public Currency getCurrency() {
return currency;
}
public void setCurrency(Currency currency) {
this.currency = currency;
}
public Locale getLocale() {
return locale;
}
public void setLocale(Locale locale) {
this.locale = locale;
}
public TimeZone getTimeZone() {
return timeZone;
}
public void setTimeZone(TimeZone timeZone) {
this.timeZone = timeZone;
}
public void setTimeZone(TimeZone timeZone) {
this.timeZone = timeZone;
}
}
@@ -1,44 +1,43 @@
package com.avaje.tests.model.basic;
import java.util.Map;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Transient;
import java.util.Map;
@Entity
public class ETransMany {
@Id
Integer id;
String name;
@Transient
Map<String,String> transMap;
@Id
Integer id;
public Integer getId() {
return id;
}
String name;
public void setId(Integer id) {
this.id = id;
}
@Transient
Map<String, String> transMap;
public String getName() {
return name;
}
public Integer getId() {
return id;
}
public void setName(String name) {
this.name = name;
}
public void setId(Integer id) {
this.id = id;
}
public Map<String, String> getTransMap() {
return transMap;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Map<String, String> getTransMap() {
return transMap;
}
public void setTransMap(Map<String, String> transMap) {
this.transMap = transMap;
}
public void setTransMap(Map<String, String> transMap) {
this.transMap = transMap;
}
}
@@ -1,12 +1,11 @@
package com.avaje.tests.model.basic;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import java.util.ArrayList;
import java.util.List;
@Entity
public class EVanillaCollection {
@@ -6,28 +6,28 @@ import javax.persistence.Id;
@Entity
public class EVanillaCollectionDetail {
@Id
Integer id;
String something;
public EVanillaCollectionDetail() {
}
@Id
Integer id;
public Integer getId() {
return id;
}
String something;
public void setId(Integer id) {
this.id = id;
}
public EVanillaCollectionDetail() {
}
public String getSomething() {
return something;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getSomething() {
return something;
}
public void setSomething(String something) {
this.something = something;
}
public void setSomething(String something) {
this.something = something;
}
}
@@ -1,24 +1,23 @@
package com.avaje.tests.model.basic;
import java.net.InetAddress;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Version;
import java.net.InetAddress;
@Entity
@Table(name="e_withinet")
@Table(name = "e_withinet")
public class EWithInetAddr {
@Id
Long id;
@Version
Long version;
String name;
InetAddress inetAddress;
public Long getId() {
@@ -52,5 +51,5 @@ public class EWithInetAddr {
public void setInetAddress(InetAddress inetAddress) {
this.inetAddress = inetAddress;
}
}
@@ -1,21 +1,21 @@
package com.avaje.tests.model.basic;
import com.avaje.ebean.annotation.Cache;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import com.avaje.ebean.annotation.Cache;
@Cache(readOnly = true)
@Entity
@Table(name="feature_desc")
public class FeatureDescription {
@Table(name = "feature_desc")
public class FeatureDescription {
@Id
private Integer id;
private String name;
private String description;
public Integer getId() {
@@ -1,34 +1,33 @@
package com.avaje.tests.model.basic;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.ManyToMany;
import java.util.Set;
@Entity
@DiscriminatorValue("1")
public class ListAttribute extends Attribute {
private static final long serialVersionUID = 1L;
@ManyToMany(mappedBy="listAttributes", cascade={CascadeType.PERSIST})
private Set<ListAttributeValue> values;// = new HashSet<ListAttributeValue>();
// Do not define this as a HashSet so that it is left up to Ebean
// to define it as a BeanSet ... and hence aware of M2M modify changes
// Put this back to HashSet and Duplicate Key Exception will return
public Set<ListAttributeValue> getValues() {
return values;
}
public void setValues(Set<ListAttributeValue> values) {
this.values = values;
}
public void add(ListAttributeValue value){
getValues().add(value);
value.getListAttributes().add(this);
}
private static final long serialVersionUID = 1L;
@ManyToMany(mappedBy = "listAttributes", cascade = {CascadeType.PERSIST})
private Set<ListAttributeValue> values;// = new HashSet<ListAttributeValue>();
// Do not define this as a HashSet so that it is left up to Ebean
// to define it as a BeanSet ... and hence aware of M2M modify changes
// Put this back to HashSet and Duplicate Key Exception will return
public Set<ListAttributeValue> getValues() {
return values;
}
public void setValues(Set<ListAttributeValue> values) {
this.values = values;
}
public void add(ListAttributeValue value) {
getValues().add(value);
value.getListAttributes().add(this);
}
}
@@ -1,34 +1,33 @@
package com.avaje.tests.model.basic;
import java.util.Set;
import javax.persistence.Entity;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
import java.util.Set;
@Entity
@Table(name="la_attr_value")
public class ListAttributeValue extends BasicDomain{
private static final long serialVersionUID = 1L;
@Table(name = "la_attr_value")
public class ListAttributeValue extends BasicDomain {
private static final long serialVersionUID = 1L;
private String name;
@ManyToMany
private Set<ListAttribute> listAttributes;
private String name;
public Set<ListAttribute> getListAttributes() {
return listAttributes;
}
@ManyToMany
private Set<ListAttribute> listAttributes;
public void setListAttribute(Set<ListAttribute> listAttributes) {
this.listAttributes = listAttributes;
}
public Set<ListAttribute> getListAttributes() {
return listAttributes;
}
public String getName() {
return name;
}
public void setListAttribute(Set<ListAttribute> listAttributes) {
this.listAttributes = listAttributes;
}
public void setName(String name) {
this.name = name;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
@@ -8,50 +8,50 @@ import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name="non_updateprop")
@Table(name = "non_updateprop")
public class MNonUpdPropEntity {
@Id
Integer id;
@Enumerated(EnumType.STRING)
MNonEnum nonEnum;
@Column(updatable=false)
String name;
String note;
@Id
Integer id;
public Integer getId() {
return id;
}
@Enumerated(EnumType.STRING)
MNonEnum nonEnum;
public void setId(Integer id) {
this.id = id;
}
@Column(updatable = false)
String name;
public String getName() {
return name;
}
String note;
public void setName(String name) {
this.name = name;
}
public Integer getId() {
return id;
}
public String getNote() {
return note;
}
public void setId(Integer id) {
this.id = id;
}
public void setNote(String note) {
this.note = note;
}
public String getName() {
return name;
}
public MNonEnum getNonEnum() {
return nonEnum;
}
public void setName(String name) {
this.name = name;
}
public String getNote() {
return note;
}
public void setNote(String note) {
this.note = note;
}
public MNonEnum getNonEnum() {
return nonEnum;
}
public void setNonEnum(MNonEnum nonEnum) {
this.nonEnum = nonEnum;
}
public void setNonEnum(MNonEnum nonEnum) {
this.nonEnum = nonEnum;
}
}
@@ -8,14 +8,14 @@ public class MProtectedConstructBean {
@Id
Long id;
String name;
// private MProtectedConstructBean() {
//
// }
public MProtectedConstructBean(String name){
public MProtectedConstructBean(String name) {
this.name = name;
}
@@ -34,5 +34,5 @@ public class MProtectedConstructBean {
public void setName(String name) {
this.name = name;
}
}
@@ -5,40 +5,40 @@ import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name="muser_type")
@Table(name = "muser_type")
public class MUserType {
@Id
Integer id;
@Id
Integer id;
String name;
String name;
public MUserType() {
super();
}
public MUserType() {
super();
}
public MUserType(String name) {
this.name = name;
}
public Integer getId() {
return id;
}
public MUserType(String name) {
this.name = name;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getId() {
return id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
@@ -7,44 +7,44 @@ import javax.persistence.Version;
@Entity
public class MnocRole {
@Id
Integer roleId;
String roleName;
@Version
Integer version;
@Id
Integer roleId;
public MnocRole() {
}
public MnocRole(String roleName) {
this.roleName = roleName;
}
public Integer getRoleId() {
return roleId;
}
String roleName;
public void setRoleId(Integer roleId) {
this.roleId = roleId;
}
@Version
Integer version;
public String getRoleName() {
return roleName;
}
public MnocRole() {
public void setRoleName(String roleName) {
this.roleName = roleName;
}
}
public Integer getVersion() {
return version;
}
public MnocRole(String roleName) {
this.roleName = roleName;
}
public Integer getRoleId() {
return roleId;
}
public void setRoleId(Integer roleId) {
this.roleId = roleId;
}
public String getRoleName() {
return roleName;
}
public void setRoleName(String roleName) {
this.roleName = roleName;
}
public Integer getVersion() {
return version;
}
public void setVersion(Integer version) {
this.version = version;
}
public void setVersion(Integer version) {
this.version = version;
}
}
@@ -1,75 +1,74 @@
package com.avaje.tests.model.basic;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.OrderBy;
import javax.persistence.Version;
import java.util.ArrayList;
import java.util.List;
@Entity
public class MnocUser {
@Id
Integer userId;
String userName;
@Version
Integer version;
@Id
Integer userId;
// No cascade REMOVE
@ManyToMany(cascade=CascadeType.PERSIST)
@OrderBy("roleName")
List<MnocRole> validRoles;
public MnocUser() {
}
public MnocUser(String userName) {
this.userName = userName;
}
String userName;
public Integer getUserId() {
return userId;
}
@Version
Integer version;
public void setUserId(Integer roleId) {
this.userId = roleId;
}
// No cascade REMOVE
@ManyToMany(cascade = CascadeType.PERSIST)
@OrderBy("roleName")
List<MnocRole> validRoles;
public String getUserName() {
return userName;
}
public MnocUser() {
public void setUserName(String roleName) {
this.userName = roleName;
}
}
public Integer getVersion() {
return version;
}
public MnocUser(String userName) {
this.userName = userName;
}
public void setVersion(Integer version) {
this.version = version;
}
public Integer getUserId() {
return userId;
}
public List<MnocRole> getValidRoles() {
return validRoles;
}
public void setUserId(Integer roleId) {
this.userId = roleId;
}
public void setValidRoles(List<MnocRole> validRoles) {
this.validRoles = validRoles;
}
public void addValidRole(MnocRole role) {
if (validRoles == null){
validRoles = new ArrayList<MnocRole>();
}
validRoles.add(role);
public String getUserName() {
return userName;
}
public void setUserName(String roleName) {
this.userName = roleName;
}
public Integer getVersion() {
return version;
}
public void setVersion(Integer version) {
this.version = version;
}
public List<MnocRole> getValidRoles() {
return validRoles;
}
public void setValidRoles(List<MnocRole> validRoles) {
this.validRoles = validRoles;
}
public void addValidRole(MnocRole role) {
if (validRoles == null) {
validRoles = new ArrayList<MnocRole>();
}
validRoles.add(role);
}
}
@@ -1,33 +1,33 @@
package com.avaje.tests.model.basic;
import com.avaje.ebean.annotation.Sql;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import com.avaje.ebean.annotation.Sql;
@Entity
@Sql
public class MyAdHoc {
@ManyToOne
Order order;
int detailCount;
@ManyToOne
Order order;
public Order getOrder() {
return order;
}
int detailCount;
public void setOrder(Order order) {
this.order = order;
}
public Order getOrder() {
return order;
}
public int getDetailCount() {
return detailCount;
}
public void setOrder(Order order) {
this.order = order;
}
public int getDetailCount() {
return detailCount;
}
public void setDetailCount(int detailCount) {
this.detailCount = detailCount;
}
public void setDetailCount(int detailCount) {
this.detailCount = detailCount;
}
}
@@ -1,12 +1,15 @@
package com.avaje.tests.model.basic;
import com.avaje.ebean.config.ServerConfig;
import com.avaje.ebean.event.AbstractBeanPersistListener;
import com.avaje.ebean.event.BulkTableEvent;
import com.avaje.ebean.event.BulkTableEventListener;
import com.avaje.ebean.event.ServerConfigStartup;
import java.util.HashSet;
import java.util.Set;
import java.util.concurrent.atomic.AtomicLong;
import com.avaje.ebean.config.ServerConfig;
import com.avaje.ebean.event.*;
public class MyEBasicConfigStartup implements ServerConfigStartup {
public static AtomicLong insertCount = new AtomicLong();
@@ -52,19 +55,19 @@ public class MyEBasicConfigStartup implements ServerConfigStartup {
public boolean inserted(Object bean) {
insertCount.incrementAndGet();
System.out.println("-- EBasic inserted " + ((EBasic)bean).getId());
System.out.println("-- EBasic inserted " + ((EBasic) bean).getId());
return false;
}
public boolean updated(Object bean, Set<String> updatedProperties) {
updateCount.incrementAndGet();
System.out.println("-- EBasic updated " + ((EBasic)bean).getId()+" updatedProperties: "+updatedProperties);
System.out.println("-- EBasic updated " + ((EBasic) bean).getId() + " updatedProperties: " + updatedProperties);
return false;
}
public boolean deleted(Object bean) {
deleteCount.incrementAndGet();
System.out.println("-- EBasic deleted " + ((EBasic)bean).getId());
System.out.println("-- EBasic deleted " + ((EBasic) bean).getId());
return false;
}
@@ -1,64 +1,63 @@
package com.avaje.tests.model.basic;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.OneToMany;
import java.util.List;
@Entity
public class MyLobSize {
@Id
Integer id;
String name;
@Basic(fetch=FetchType.LAZY)
int myCount;
@Basic(fetch=FetchType.LAZY)
@Lob
//@Length(max=65535)
//@Length(max=65536)
String myLob;
@OneToMany(mappedBy="parent")
List<MyLobSizeJoinMany> details;
@Id
Integer id;
public Integer getId() {
return id;
}
String name;
public void setId(Integer id) {
this.id = id;
}
@Basic(fetch = FetchType.LAZY)
int myCount;
public String getMyLob() {
return myLob;
}
@Basic(fetch = FetchType.LAZY)
@Lob
//@Length(max=65535)
//@Length(max=65536)
String myLob;
public void setMyLob(String myLob) {
this.myLob = myLob;
}
@OneToMany(mappedBy = "parent")
List<MyLobSizeJoinMany> details;
public String getName() {
return name;
}
public Integer getId() {
return id;
}
public void setName(String name) {
this.name = name;
}
public void setId(Integer id) {
this.id = id;
}
public int getMyCount() {
return myCount;
}
public String getMyLob() {
return myLob;
}
public void setMyCount(int myCount) {
this.myCount = myCount;
}
public void setMyLob(String myLob) {
this.myLob = myLob;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getMyCount() {
return myCount;
}
public void setMyCount(int myCount) {
this.myCount = myCount;
}
}
@@ -9,48 +9,48 @@ import javax.persistence.ManyToOne;
@Entity
public class MyLobSizeJoinMany {
@Id
Integer id;
@Basic(fetch=FetchType.LAZY)
String something;
String other;
@ManyToOne
MyLobSize parent;
@Id
Integer id;
public Integer getId() {
return id;
}
@Basic(fetch = FetchType.LAZY)
String something;
public void setId(Integer id) {
this.id = id;
}
String other;
public String getSomething() {
return something;
}
@ManyToOne
MyLobSize parent;
public void setSomething(String something) {
this.something = something;
}
public Integer getId() {
return id;
}
public String getOther() {
return other;
}
public void setId(Integer id) {
this.id = id;
}
public void setOther(String other) {
this.other = other;
}
public String getSomething() {
return something;
}
public void setSomething(String something) {
this.something = something;
}
public String getOther() {
return other;
}
public void setOther(String other) {
this.other = other;
}
public MyLobSize getParent() {
return parent;
}
public void setParent(MyLobSize parent) {
this.parent = parent;
}
public MyLobSize getParent() {
return parent;
}
public void setParent(MyLobSize parent) {
this.parent = parent;
}
}
@@ -1,7 +1,6 @@
package com.avaje.tests.model.basic;
import java.util.ArrayList;
import java.util.List;
import com.avaje.ebean.annotation.Cache;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
@@ -9,8 +8,8 @@ import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import com.avaje.ebean.annotation.Cache;
import java.util.ArrayList;
import java.util.List;
/**
* Cached bean for testing caching implementation.
@@ -1,12 +1,12 @@
package com.avaje.tests.model.basic;
import com.avaje.ebean.annotation.Cache;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import com.avaje.ebean.annotation.Cache;
/**
* Cached bean for testing caching implementation, especially relations.
*/
@@ -15,25 +15,25 @@ import com.avaje.ebean.annotation.Cache;
@Table(name = "o_cached_bean_child")
public class OCachedBeanChild {
@Id
Long id;
@Id
Long id;
@ManyToOne
OCachedBean cachedBean;
@ManyToOne
OCachedBean cachedBean;
public Long getId() {
return id;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public void setId(Long id) {
this.id = id;
}
public OCachedBean getCachedBean() {
return cachedBean;
}
public OCachedBean getCachedBean() {
return cachedBean;
}
public void setCachedBean(OCachedBean cachedBean) {
this.cachedBean = cachedBean;
}
public void setCachedBean(OCachedBean cachedBean) {
this.cachedBean = cachedBean;
}
}
@@ -7,58 +7,58 @@ import javax.persistence.OneToOne;
@Entity
public class OCar extends BasicDomain {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
private String vin;
private String name;
private String vin;
@OneToOne(mappedBy="car",cascade=CascadeType.ALL)
private OGearBox gearBox;
private String name;
@OneToOne(mappedBy="car",cascade=CascadeType.ALL)
private OEngine engine;
public OCar() {
}
@OneToOne(mappedBy = "car", cascade = CascadeType.ALL)
private OGearBox gearBox;
public OCar(String vin, String name) {
super();
this.vin = vin;
this.name = name;
}
@OneToOne(mappedBy = "car", cascade = CascadeType.ALL)
private OEngine engine;
public String getVin() {
return vin;
}
public OCar() {
}
public void setVin(String vin) {
this.vin = vin;
}
public OCar(String vin, String name) {
super();
this.vin = vin;
this.name = name;
}
public String getName() {
return name;
}
public String getVin() {
return vin;
}
public void setName(String name) {
this.name = name;
}
public void setVin(String vin) {
this.vin = vin;
}
public OGearBox getGearBox() {
return gearBox;
}
public String getName() {
return name;
}
public void setGearBox(OGearBox gearBox) {
this.gearBox = gearBox;
gearBox.setCar(this);
}
public void setName(String name) {
this.name = name;
}
public OEngine getEngine() {
return engine;
}
public OGearBox getGearBox() {
return gearBox;
}
public void setEngine(OEngine engine) {
this.engine = engine;
engine.setCar(this);
}
public void setGearBox(OGearBox gearBox) {
this.gearBox = gearBox;
gearBox.setCar(this);
}
public OEngine getEngine() {
return engine;
}
public void setEngine(OEngine engine) {
this.engine = engine;
engine.setCar(this);
}
}
@@ -1,62 +1,61 @@
package com.avaje.tests.model.basic;
import java.util.UUID;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.Version;
import java.util.UUID;
@Entity
public class OEngine {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
@Id
private UUID engineId;
@Id
private UUID engineId;
private String shortDesc;
@Version
private Integer version;
@OneToOne
private OCar car;
public OEngine() {
}
private String shortDesc;
public UUID getEngineId() {
return engineId;
}
@Version
private Integer version;
public void setEngineId(UUID engineId) {
this.engineId = engineId;
}
@OneToOne
private OCar car;
public String getShortDesc() {
return shortDesc;
}
public OEngine() {
}
public void setShortDesc(String shortDesc) {
this.shortDesc = shortDesc;
}
public UUID getEngineId() {
return engineId;
}
public OCar getCar() {
return car;
}
public void setEngineId(UUID engineId) {
this.engineId = engineId;
}
public void setCar(OCar car) {
this.car = car;
}
public String getShortDesc() {
return shortDesc;
}
public Integer getVersion() {
return version;
}
public void setShortDesc(String shortDesc) {
this.shortDesc = shortDesc;
}
public OCar getCar() {
return car;
}
public void setCar(OCar car) {
this.car = car;
}
public Integer getVersion() {
return version;
}
public void setVersion(Integer version) {
this.version = version;
}
public void setVersion(Integer version) {
this.version = version;
}
}
@@ -1,73 +1,72 @@
package com.avaje.tests.model.basic;
import java.util.UUID;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.Version;
import java.util.UUID;
@Entity
public class OGearBox {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
@Id
private UUID id;
@Id
private UUID id;
private String boxDesc;
private String boxDesc;
@Column(name="box_size")
private Integer size;
@Version
private Integer version;
@OneToOne
private OCar car;
public OGearBox() {
}
@Column(name = "box_size")
private Integer size;
public UUID getId() {
return id;
}
@Version
private Integer version;
public void setId(UUID id) {
this.id = id;
}
@OneToOne
private OCar car;
public String getBoxDesc() {
return boxDesc;
}
public OGearBox() {
}
public void setBoxDesc(String boxDesc) {
this.boxDesc = boxDesc;
}
public UUID getId() {
return id;
}
public Integer getSize() {
return size;
}
public void setId(UUID id) {
this.id = id;
}
public void setSize(Integer size) {
this.size = size;
}
public String getBoxDesc() {
return boxDesc;
}
public OCar getCar() {
return car;
}
public void setBoxDesc(String boxDesc) {
this.boxDesc = boxDesc;
}
public void setCar(OCar car) {
this.car = car;
}
public Integer getSize() {
return size;
}
public Integer getVersion() {
return version;
}
public void setSize(Integer size) {
this.size = size;
}
public void setVersion(Integer version) {
this.version = version;
}
public OCar getCar() {
return car;
}
public void setCar(OCar car) {
this.car = car;
}
public Integer getVersion() {
return version;
}
public void setVersion(Integer version) {
this.version = version;
}
}
@@ -1,10 +1,10 @@
package com.avaje.tests.model.basic;
import com.avaje.ebean.annotation.Sql;
import javax.persistence.Entity;
import javax.persistence.OneToOne;
import com.avaje.ebean.annotation.Sql;
/**
* An example of an Aggregate object.
* <p>
@@ -16,38 +16,38 @@ import com.avaje.ebean.annotation.Sql;
@Sql
public class OrderAggregate {
@OneToOne
Order order;
@OneToOne
Order order;
Double totalAmount;
Double totalAmount;
Double totalItems;
Double totalItems;
public String toString() {
return order.getId() + " totalAmount:" + totalAmount + " totalItems:" + totalItems;
}
public String toString() {
return order.getId() + " totalAmount:" + totalAmount + " totalItems:" + totalItems;
}
public Order getOrder() {
return order;
}
public Order getOrder() {
return order;
}
public void setOrder(Order order) {
this.order = order;
}
public void setOrder(Order order) {
this.order = order;
}
public Double getTotalAmount() {
return totalAmount;
}
public Double getTotalAmount() {
return totalAmount;
}
public void setTotalAmount(Double totalAmount) {
this.totalAmount = totalAmount;
}
public void setTotalAmount(Double totalAmount) {
this.totalAmount = totalAmount;
}
public Double getTotalItems() {
return totalItems;
}
public Double getTotalItems() {
return totalItems;
}
public void setTotalItems(Double totalItems) {
this.totalItems = totalItems;
}
public void setTotalItems(Double totalItems) {
this.totalItems = totalItems;
}
}
@@ -1,36 +1,35 @@
package com.avaje.tests.model.basic;
import java.sql.Timestamp;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import java.sql.Timestamp;
@Entity
@Table(name="or_order_ship")
@Table(name = "or_order_ship")
public class OrderShipment extends BasicDomain {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
@ManyToOne
private Order order;
private Timestamp shipTime = new Timestamp(System.currentTimeMillis());
@ManyToOne
private Order order;
public Timestamp getShipTime() {
return shipTime;
}
private Timestamp shipTime = new Timestamp(System.currentTimeMillis());
public void setShipTime(Timestamp shipTime) {
this.shipTime = shipTime;
}
public Timestamp getShipTime() {
return shipTime;
}
public Order getOrder() {
return order;
}
public void setShipTime(Timestamp shipTime) {
this.shipTime = shipTime;
}
public void setOrder(Order order) {
this.order = order;
}
public Order getOrder() {
return order;
}
public void setOrder(Order order) {
this.order = order;
}
}
@@ -7,48 +7,50 @@ import javax.persistence.OneToOne;
@Entity
public class PFile extends BasicDomain {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
private String name;
private String name;
@OneToOne(cascade=CascadeType.ALL)
private PFileContent fileContent;
@OneToOne(cascade = CascadeType.ALL)
private PFileContent fileContent;
/** Another persistent file. */
@OneToOne(cascade=CascadeType.ALL)
/**
* Another persistent file.
*/
@OneToOne(cascade = CascadeType.ALL)
private PFileContent fileContent2;
public PFile() {
}
public PFile() {
}
public PFile(String name,PFileContent fileContent) {
super();
this.name = name;
this.fileContent = fileContent;
}
public PFile(String name, PFileContent fileContent) {
super();
this.name = name;
this.fileContent = fileContent;
}
public String getName() {
return name;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public void setName(String name) {
this.name = name;
}
public PFileContent getFileContent() {
return fileContent;
return fileContent;
}
public void setFileContent(PFileContent fileContent) {
this.fileContent = fileContent;
this.fileContent = fileContent;
}
public PFileContent getFileContent2() {
return fileContent2;
return fileContent2;
}
public void setFileContent2(PFileContent fileContent2) {
this.fileContent2 = fileContent2;
this.fileContent2 = fileContent2;
}
}
@@ -5,26 +5,28 @@ import javax.persistence.Lob;
@Entity
public class PFileContent extends BasicDomain {
private static final long serialVersionUID = 1L;
/** The content. */
@Lob
private byte[] content;
private static final long serialVersionUID = 1L;
public PFileContent(){
}
/**
* The content.
*/
@Lob
private byte[] content;
public PFileContent(byte[] content) {
super();
this.content = content;
}
public PFileContent() {
}
public byte[] getContent() {
return content;
}
public PFileContent(byte[] content) {
super();
this.content = content;
}
public void setContent(byte[] content) {
this.content = content;
}
public byte[] getContent() {
return content;
}
public void setContent(byte[] content) {
this.content = content;
}
}
@@ -7,39 +7,39 @@ import javax.persistence.OneToOne;
@Entity
public class PersistentFile extends BasicDomain {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
private String name;
private String name;
@OneToOne(mappedBy="persistentFile", cascade=CascadeType.ALL)
private PersistentFileContent persistentFileContent;
@OneToOne(mappedBy = "persistentFile", cascade = CascadeType.ALL)
private PersistentFileContent persistentFileContent;
public PersistentFile() {
}
public PersistentFile() {
}
public PersistentFile(String name,
PersistentFileContent persistentFileContent) {
super();
this.name = name;
this.persistentFileContent = persistentFileContent;
public PersistentFile(String name,
PersistentFileContent persistentFileContent) {
super();
this.name = name;
this.persistentFileContent = persistentFileContent;
this.persistentFileContent.setPersistentFile(this);
}
this.persistentFileContent.setPersistentFile(this);
}
public String getName() {
return name;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public void setName(String name) {
this.name = name;
}
public PersistentFileContent getPersistentFileContent() {
return persistentFileContent;
}
public PersistentFileContent getPersistentFileContent() {
return persistentFileContent;
}
public void setPersistentFileContent(PersistentFileContent persistentFileContent) {
this.persistentFileContent = persistentFileContent;
}
public void setPersistentFileContent(PersistentFileContent persistentFileContent) {
this.persistentFileContent = persistentFileContent;
}
}
@@ -7,38 +7,42 @@ import javax.persistence.OneToOne;
@Entity
public class PersistentFileContent extends BasicDomain {
private static final long serialVersionUID = 1L;
/** The persistent file. */
@OneToOne(cascade=CascadeType.ALL)
private PersistentFile persistentFile;
private static final long serialVersionUID = 1L;
/** The content. */
@Lob
private byte[] content;
/**
* The persistent file.
*/
@OneToOne(cascade = CascadeType.ALL)
private PersistentFile persistentFile;
public PersistentFileContent(){
}
/**
* The content.
*/
@Lob
private byte[] content;
public PersistentFileContent(byte[] content) {
super();
this.content = content;
}
public PersistentFileContent() {
}
public PersistentFile getPersistentFile() {
return persistentFile;
}
public PersistentFileContent(byte[] content) {
super();
this.content = content;
}
public void setPersistentFile(PersistentFile persistentFile) {
this.persistentFile = persistentFile;
}
public PersistentFile getPersistentFile() {
return persistentFile;
}
public byte[] getContent() {
return content;
}
public void setPersistentFile(PersistentFile persistentFile) {
this.persistentFile = persistentFile;
}
public void setContent(byte[] content) {
this.content = content;
}
public byte[] getContent() {
return content;
}
public void setContent(byte[] content) {
this.content = content;
}
}
@@ -1,6 +1,14 @@
package com.avaje.tests.model.basic;
import javax.persistence.*;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.List;
@@ -8,53 +16,53 @@ import java.util.List;
@Table(name = "PERSONS")
public class Person implements Serializable {
private static final long serialVersionUID = 495045977245770183L;
private Long id;
private String surname;
private String name;
private List<Phone> phones;
private static final long serialVersionUID = 495045977245770183L;
public Person() {
}
private Long id;
private String surname;
private String name;
private List<Phone> phones;
@Id
@GeneratedValue(strategy = javax.persistence.GenerationType.AUTO)
@SequenceGenerator(name="PERSONS_SEQ", initialValue = 1000, allocationSize = 40)
@Column(name = "ID", unique = true, nullable = false)
public Long getId() {
return id;
}
public Person() {
}
public void setId(Long id) {
this.id = id;
}
@Id
@GeneratedValue(strategy = javax.persistence.GenerationType.AUTO)
@SequenceGenerator(name = "PERSONS_SEQ", initialValue = 1000, allocationSize = 40)
@Column(name = "ID", unique = true, nullable = false)
public Long getId() {
return id;
}
@Column(name = "SURNAME", nullable = false, unique = false, columnDefinition = "varchar(64)")
public String getSurname() {
return surname;
}
public void setId(Long id) {
this.id = id;
}
public void setSurname(String surname) {
this.surname = surname;
}
@Column(name = "SURNAME", nullable = false, unique = false, columnDefinition = "varchar(64)")
public String getSurname() {
return surname;
}
@Column(name = "NAME", nullable = false, unique = false, columnDefinition = "varchar(64)")
public String getName() {
return name;
}
public void setSurname(String surname) {
this.surname = surname;
}
public void setName(String name) {
this.name = name;
}
@Column(name = "NAME", nullable = false, unique = false, columnDefinition = "varchar(64)")
public String getName() {
return name;
}
@OneToMany(targetEntity = Phone.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "person")
public List<Phone> getPhones() {
return phones;
}
public void setName(String name) {
this.name = name;
}
public void setPhones(List<Phone> phones) {
this.phones = phones;
}
@OneToMany(targetEntity = Phone.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "person")
public List<Phone> getPhones() {
return phones;
}
public void setPhones(List<Phone> phones) {
this.phones = phones;
}
}
@@ -1,7 +1,5 @@
package com.avaje.tests.model.basic;
import java.io.Serializable;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
@@ -12,49 +10,50 @@ import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
@Entity(name = "Phone")
@Table(name = "PHONES")
public class Phone implements Serializable {
private static final long serialVersionUID = -326610269092956952L;
private static final long serialVersionUID = -326610269092956952L;
private Long id;
private String phoneNumber;
private Person person;
private Long id;
private String phoneNumber;
private Person person;
public Phone() {
}
public Phone() {
}
@Id
@GeneratedValue(strategy = javax.persistence.GenerationType.AUTO)
@Column(name = "ID", unique = true, nullable = false)
public Long getId() {
return id;
}
@Id
@GeneratedValue(strategy = javax.persistence.GenerationType.AUTO)
@Column(name = "ID", unique = true, nullable = false)
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public void setId(Long id) {
this.id = id;
}
@Column(name = "PHONE_NUMBER", nullable = false, unique = true, columnDefinition = "varchar(7)")
public String getPhoneNumber() {
return phoneNumber;
}
@Column(name = "PHONE_NUMBER", nullable = false, unique = true, columnDefinition = "varchar(7)")
public String getPhoneNumber() {
return phoneNumber;
}
public void setPhoneNumber(String phoneNumber) {
this.phoneNumber = phoneNumber;
}
public void setPhoneNumber(String phoneNumber) {
this.phoneNumber = phoneNumber;
}
@NotNull
@ManyToOne(targetEntity = Person.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@JoinColumn(name = "PERSON_ID", nullable = false)
public Person getPerson() {
return person;
}
@NotNull
@ManyToOne(targetEntity = Person.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@JoinColumn(name = "PERSON_ID", nullable = false)
public Person getPerson() {
return person;
}
public void setPerson(Person person) {
this.person = person;
}
public void setPerson(Person person) {
this.person = person;
}
}
@@ -1,18 +1,17 @@
package com.avaje.tests.model.basic;
import java.io.Serializable;
import java.sql.Timestamp;
import com.avaje.ebean.annotation.Cache;
import com.avaje.ebean.annotation.CacheQueryTuning;
import com.avaje.ebean.annotation.CreatedTimestamp;
import com.avaje.ebean.annotation.DocStore;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Version;
import javax.validation.constraints.Size;
import com.avaje.ebean.annotation.CacheQueryTuning;
import com.avaje.ebean.annotation.Cache;
import com.avaje.ebean.annotation.CreatedTimestamp;
import com.avaje.ebean.annotation.DocStore;
import java.io.Serializable;
import java.sql.Timestamp;
/**
* Product entity bean.
@@ -1,82 +1,81 @@
package com.avaje.tests.model.basic;
import java.util.ArrayList;
import java.util.List;
import com.avaje.ebean.annotation.Cache;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import com.avaje.ebean.annotation.Cache;
import java.util.ArrayList;
import java.util.List;
@Cache
@Entity
public class Section extends BasicDomain {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
public enum Type {
GENERAL,
NOTE
}
@ManyToOne
Article article;
Type type = Type.GENERAL;
@Lob
String content;
@OneToMany(cascade=CascadeType.ALL)
List<SubSection> subSections;
public enum Type {
GENERAL,
NOTE
}
public Section() {
}
@ManyToOne
Article article;
public Section(String content) {
this.content = content;
}
public Type getType() {
return type;
}
Type type = Type.GENERAL;
public void setType(Type type) {
this.type = type;
}
@Lob
String content;
public String getContent() {
return content;
}
@OneToMany(cascade = CascadeType.ALL)
List<SubSection> subSections;
public void setContent(String content) {
this.content = content;
}
public Section() {
}
public Article getArticle() {
return article;
}
public Section(String content) {
this.content = content;
}
public void setArticle(Article article) {
this.article = article;
}
public Type getType() {
return type;
}
public List<SubSection> getSubSections() {
return subSections;
}
public void setType(Type type) {
this.type = type;
}
public void setSubSections(List<SubSection> subSections) {
this.subSections = subSections;
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public Article getArticle() {
return article;
}
public void setArticle(Article article) {
this.article = article;
}
public List<SubSection> getSubSections() {
return subSections;
}
public void setSubSections(List<SubSection> subSections) {
this.subSections = subSections;
}
public void addSubSection(SubSection s) {
if (subSections == null) {
subSections = new ArrayList<SubSection>();
}
public void addSubSection(SubSection s){
if (subSections == null){
subSections = new ArrayList<SubSection>();
}
subSections.add(s);
}
subSections.add(s);
}
}
@@ -4,13 +4,13 @@ public enum SomeEnum {
ALPHA("Some nice Alpha"),
BETA("Some nice Beta");
String description;
SomeEnum(String description) {
this.description = description;
}
public String toString() {
return description;
}
@@ -7,12 +7,12 @@ import javax.persistence.Id;
@Entity
public class SomeEnumBean {
@Id
@Id
Long id;
@Enumerated
SomeEnum someEnum;
String name;
public Long getId() {
@@ -38,5 +38,5 @@ public class SomeEnumBean {
public void setName(String name) {
this.name = name;
}
}
@@ -2,21 +2,24 @@ package com.avaje.tests.model.basic;
public class SomeObject {
String nonScalar;
Integer value;
public String getNonScalar() {
return nonScalar;
}
public void setNonScalar(String nonScalar) {
this.nonScalar = nonScalar;
}
public Integer getValue() {
return value;
}
public void setValue(Integer value) {
this.value = value;
}
String nonScalar;
Integer value;
public String getNonScalar() {
return nonScalar;
}
public void setNonScalar(String nonScalar) {
this.nonScalar = nonScalar;
}
public Integer getValue() {
return value;
}
public void setValue(Integer value) {
this.value = value;
}
}
@@ -1,34 +1,34 @@
package com.avaje.tests.model.basic;
import com.avaje.ebean.annotation.Cache;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import com.avaje.ebean.annotation.Cache;
@Cache
@Entity
public class SubSection extends BasicDomain {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
@ManyToOne
private Section section;
@ManyToOne
private Section section;
private String title;
private String title;
public SubSection() {
}
public SubSection() {
}
public SubSection(String title) {
this.title = title;
}
public SubSection(String title) {
this.title = title;
}
public String getTitle() {
return title;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public void setTitle(String title) {
this.title = title;
}
}
@@ -9,27 +9,27 @@ import javax.persistence.Lob;
@Entity
public class TBytesOnly {
@Id
Integer id;
@Lob
@Basic(fetch=FetchType.EAGER)
byte[] content;
@Id
Integer id;
public Integer getId() {
return id;
}
@Lob
@Basic(fetch = FetchType.EAGER)
byte[] content;
public void setId(Integer id) {
this.id = id;
}
public Integer getId() {
return id;
}
public byte[] getContent() {
return content;
}
public void setId(Integer id) {
this.id = id;
}
public byte[] getContent() {
return content;
}
public void setContent(byte[] content) {
this.content = content;
}
public void setContent(byte[] content) {
this.content = content;
}
}
@@ -9,16 +9,16 @@ import javax.persistence.Inheritance;
@DiscriminatorValue("2")
public class TIntChild extends TIntRoot {
private static final long serialVersionUID = 1L;
String childProperty;
private static final long serialVersionUID = 1L;
public String getChildProperty() {
return childProperty;
}
String childProperty;
public String getChildProperty() {
return childProperty;
}
public void setChildProperty(String childProperty) {
this.childProperty = childProperty;
}
public void setChildProperty(String childProperty) {
this.childProperty = childProperty;
}
}
@@ -9,29 +9,29 @@ import javax.persistence.Inheritance;
@Entity
@Inheritance
@DiscriminatorColumn(name="my_type",length=3,discriminatorType=DiscriminatorType.INTEGER)
@DiscriminatorColumn(name = "my_type", length = 3, discriminatorType = DiscriminatorType.INTEGER)
@DiscriminatorValue("1")
public class TIntRoot {
@Id
Integer id;
String name;
@Id
Integer id;
public Integer getId() {
return id;
}
String name;
public void setId(Integer id) {
this.id = id;
}
public Integer getId() {
return id;
}
public String getName() {
return name;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public void setName(String name) {
this.name = name;
}
}
@@ -1,32 +1,32 @@
package com.avaje.tests.model.basic;
import org.joda.time.LocalTime;
import javax.persistence.Entity;
import javax.persistence.Id;
import org.joda.time.LocalTime;
@Entity
public class TJodaEntity {
@Id
Integer id;
LocalTime localTime;
@Id
Integer id;
public Integer getId() {
return id;
}
LocalTime localTime;
public void setId(Integer id) {
this.id = id;
}
public Integer getId() {
return id;
}
public LocalTime getLocalTime() {
return localTime;
}
public void setId(Integer id) {
this.id = id;
}
public void setLocalTime(LocalTime localTime) {
this.localTime = localTime;
}
public LocalTime getLocalTime() {
return localTime;
}
public void setLocalTime(LocalTime localTime) {
this.localTime = localTime;
}
}
@@ -1,37 +1,37 @@
package com.avaje.tests.model.basic;
import com.avaje.ebean.annotation.UpdateMode;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import com.avaje.ebean.annotation.UpdateMode;
@Entity
@Table(name="t_mapsuper1")
@UpdateMode(updateChangesOnly=true)
@Table(name = "t_mapsuper1")
@UpdateMode(updateChangesOnly = true)
public class TMapSuperEntity extends TMappedSuper2 {
private static final long serialVersionUID = 1L;
@Id
Integer id;
String name;
private static final long serialVersionUID = 1L;
public Integer getId() {
return id;
}
@Id
Integer id;
public void setId(Integer id) {
this.id = id;
}
String name;
public String getName() {
return name;
}
public Integer getId() {
return id;
}
public void setName(String name) {
this.name = name;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
@@ -1,4 +1,3 @@
package com.avaje.tests.model.basic;
import javax.persistence.MappedSuperclass;
@@ -8,48 +7,48 @@ import javax.persistence.Version;
@MappedSuperclass
public class TMappedSuper2 {
String something;
@Version
int version;
@Transient
SomeObject someObject;
String something;
@Transient
Integer myint;
@Version
int version;
public String getSomething() {
return something;
}
@Transient
SomeObject someObject;
public void setSomething(String something) {
this.something = something;
}
@Transient
Integer myint;
public SomeObject getSomeObject() {
return someObject;
}
public String getSomething() {
return something;
}
public void setSomeObject(SomeObject someObject) {
this.someObject = someObject;
}
public void setSomething(String something) {
this.something = something;
}
public Integer getMyint() {
return myint;
}
public SomeObject getSomeObject() {
return someObject;
}
public void setMyint(Integer myint) {
this.myint = myint;
}
public void setSomeObject(SomeObject someObject) {
this.someObject = someObject;
}
public int getVersion() {
return version;
}
public Integer getMyint() {
return myint;
}
public void setVersion(int version) {
this.version = version;
}
public void setMyint(Integer myint) {
this.myint = myint;
}
public int getVersion() {
return version;
}
public void setVersion(int version) {
this.version = version;
}
}
@@ -11,45 +11,45 @@ import javax.persistence.Table;
@Table(name = "t_oneb")
public class TOne {
@Id
Integer id;
@Id
Integer id;
String name;
String name;
String description;
String description;
boolean active;
boolean active;
public Integer getId() {
return id;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public void setDescription(String description) {
this.description = description;
}
public boolean isActive() {
return active;
}
public boolean isActive() {
return active;
}
public void setActive(boolean active) {
this.active = active;
}
public void setActive(boolean active) {
this.active = active;
}
}
@@ -14,64 +14,65 @@ import javax.persistence.Table;
@Table(name = "t_detail_with_other_namexxxyy")
public class TSDetail {
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "t_atable_detail_seq")
@Id
Integer id;
String name;
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "t_atable_detail_seq")
@Id
Integer id;
String description;
String name;
boolean active;
@ManyToOne
TSMaster master;
String description;
public TSDetail(String name){
this.name = name;
}
public TSDetail() {
}
public Integer getId() {
return id;
}
boolean active;
public void setId(Integer id) {
this.id = id;
}
@ManyToOne
TSMaster master;
public String getName() {
return name;
}
public TSDetail(String name) {
this.name = name;
}
public void setName(String name) {
this.name = name;
}
public TSDetail() {
public String getDescription() {
return description;
}
}
public void setDescription(String description) {
this.description = description;
}
public Integer getId() {
return id;
}
public boolean isActive() {
return active;
}
public void setId(Integer id) {
this.id = id;
}
public void setActive(boolean active) {
this.active = active;
}
public String getName() {
return name;
}
public TSMaster getMaster() {
return master;
}
public void setName(String name) {
this.name = name;
}
public void setMaster(TSMaster master) {
this.master = master;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public boolean isActive() {
return active;
}
public void setActive(boolean active) {
this.active = active;
}
public TSMaster getMaster() {
return master;
}
public void setMaster(TSMaster master) {
this.master = master;
}
}
@@ -12,62 +12,63 @@ import javax.persistence.Table;
@Table(name = "ts_detail_two")
public class TSDetailTwo {
@Id
Integer id;
@Id
Integer id;
String name;
String name;
String description;
String description;
boolean active;
@ManyToOne
TSMasterTwo master;
boolean active;
public TSDetailTwo(String name){
this.name = name;
}
public TSDetailTwo() {
}
public Integer getId() {
return id;
}
@ManyToOne
TSMasterTwo master;
public void setId(Integer id) {
this.id = id;
}
public TSDetailTwo(String name) {
this.name = name;
}
public String getName() {
return name;
}
public TSDetailTwo() {
public void setName(String name) {
this.name = name;
}
}
public String getDescription() {
return description;
}
public Integer getId() {
return id;
}
public void setDescription(String description) {
this.description = description;
}
public void setId(Integer id) {
this.id = id;
}
public boolean isActive() {
return active;
}
public String getName() {
return name;
}
public void setActive(boolean active) {
this.active = active;
}
public void setName(String name) {
this.name = name;
}
public TSMasterTwo getMaster() {
return master;
}
public String getDescription() {
return description;
}
public void setMaster(TSMasterTwo master) {
this.master = master;
}
public void setDescription(String description) {
this.description = description;
}
public boolean isActive() {
return active;
}
public void setActive(boolean active) {
this.active = active;
}
public TSMasterTwo getMaster() {
return master;
}
public void setMaster(TSMasterTwo master) {
this.master = master;
}
}
@@ -1,7 +1,6 @@
package com.avaje.tests.model.basic;
import java.util.ArrayList;
import java.util.List;
import com.avaje.ebean.annotation.PrivateOwned;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
@@ -10,8 +9,8 @@ import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import com.avaje.ebean.annotation.PrivateOwned;
import java.util.ArrayList;
import java.util.List;
/**
* A basic entity to test simple things.
@@ -20,65 +19,65 @@ import com.avaje.ebean.annotation.PrivateOwned;
@Table(name = "t_atable_thatisrelatively")
public class TSMaster {
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "t_atable_master_seq")
@Id
Integer id;
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "t_atable_master_seq")
@Id
Integer id;
String name;
String name;
String description;
String description;
boolean active;
@OneToMany(cascade=CascadeType.ALL,mappedBy="master")
@PrivateOwned
List<TSDetail> details;
boolean active;
public Integer getId() {
return id;
}
@OneToMany(cascade = CascadeType.ALL, mappedBy = "master")
@PrivateOwned
List<TSDetail> details;
public void setId(Integer id) {
this.id = id;
}
public Integer getId() {
return id;
}
public String getName() {
return name;
}
public void setId(Integer id) {
this.id = id;
}
public void setName(String name) {
this.name = name;
}
public String getName() {
return name;
}
public String getDescription() {
return description;
}
public void setName(String name) {
this.name = name;
}
public void setDescription(String description) {
this.description = description;
}
public String getDescription() {
return description;
}
public boolean isActive() {
return active;
}
public void setDescription(String description) {
this.description = description;
}
public void setActive(boolean active) {
this.active = active;
}
public boolean isActive() {
return active;
}
public List<TSDetail> getDetails() {
return details;
}
public void setActive(boolean active) {
this.active = active;
}
public List<TSDetail> getDetails() {
return details;
}
public void setDetails(List<TSDetail> details) {
this.details = details;
}
public void addDetail(TSDetail detail) {
if (details == null) {
details = new ArrayList<TSDetail>();
}
details.add(detail);
}
public void setDetails(List<TSDetail> details) {
this.details = details;
}
public void addDetail(TSDetail detail) {
if (details == null){
details = new ArrayList<TSDetail>();
}
details.add(detail);
}
}
@@ -1,15 +1,14 @@
package com.avaje.tests.model.basic;
import java.util.ArrayList;
import java.util.List;
import com.avaje.ebean.annotation.PrivateOwned;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import com.avaje.ebean.annotation.PrivateOwned;
import java.util.ArrayList;
import java.util.List;
/**
* A basic entity to test simple things.
@@ -18,63 +17,63 @@ import com.avaje.ebean.annotation.PrivateOwned;
@Table(name = "ts_master_two")
public class TSMasterTwo {
@Id
Integer id;
@Id
Integer id;
String name;
String name;
String description;
String description;
boolean active;
@OneToMany(cascade=CascadeType.ALL,mappedBy="master")
@PrivateOwned(cascadeRemove=false)
List<TSDetailTwo> details;
boolean active;
public Integer getId() {
return id;
}
@OneToMany(cascade = CascadeType.ALL, mappedBy = "master")
@PrivateOwned(cascadeRemove = false)
List<TSDetailTwo> details;
public void setId(Integer id) {
this.id = id;
}
public Integer getId() {
return id;
}
public String getName() {
return name;
}
public void setId(Integer id) {
this.id = id;
}
public void setName(String name) {
this.name = name;
}
public String getName() {
return name;
}
public String getDescription() {
return description;
}
public void setName(String name) {
this.name = name;
}
public void setDescription(String description) {
this.description = description;
}
public String getDescription() {
return description;
}
public boolean isActive() {
return active;
}
public void setDescription(String description) {
this.description = description;
}
public void setActive(boolean active) {
this.active = active;
}
public boolean isActive() {
return active;
}
public List<TSDetailTwo> getDetails() {
return details;
}
public void setActive(boolean active) {
this.active = active;
}
public void setDetails(List<TSDetailTwo> details) {
this.details = details;
}
public void addDetail(TSDetailTwo detail) {
if (details == null){
details = new ArrayList<TSDetailTwo>();
}
details.add(detail);
}
public List<TSDetailTwo> getDetails() {
return details;
}
public void setDetails(List<TSDetailTwo> details) {
this.details = details;
}
public void addDetail(TSDetailTwo detail) {
if (details == null) {
details = new ArrayList<TSDetailTwo>();
}
details.add(detail);
}
}
@@ -1,32 +1,31 @@
package com.avaje.tests.model.basic;
import java.util.UUID;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.util.UUID;
@Entity
public class TUuidEntity {
@Id
private UUID id;
private String name;
@Id
private UUID id;
public UUID getId() {
return id;
}
private String name;
public void setId(UUID id) {
this.id = id;
}
public UUID getId() {
return id;
}
public String getName() {
return name;
}
public void setId(UUID id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public void setName(String name) {
this.name = name;
}
}
@@ -7,36 +7,36 @@ import javax.validation.constraints.NotNull;
@Entity
public class TWithPreInsert {
@Id
private Integer id;
@NotNull
private String name;
private String title;
@Id
private Integer id;
public Integer getId() {
return id;
}
@NotNull
private String name;
public void setId(Integer id) {
this.id = id;
}
private String title;
public String getName() {
return name;
}
public Integer getId() {
return id;
}
public void setName(String name) {
this.name = name;
}
public void setId(Integer id) {
this.id = id;
}
public String getTitle() {
return title;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public void setTitle(String title) {
this.title = title;
}
}
@@ -1,56 +1,55 @@
package com.avaje.tests.model.basic;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import java.util.Date;
@Entity
public class Trip extends BasicDomain {
private static final long serialVersionUID = 1L;
@ManyToOne
private VehicleDriver vehicleDriver;
private String destination;
@ManyToOne
private Address address;
private Date starDate;
private static final long serialVersionUID = 1L;
public VehicleDriver getVehicleDriver() {
return vehicleDriver;
}
@ManyToOne
private VehicleDriver vehicleDriver;
public void setVehicleDriver(VehicleDriver vehicleDriver) {
this.vehicleDriver = vehicleDriver;
}
private String destination;
public String getDestination() {
return destination;
}
@ManyToOne
private Address address;
public void setDestination(String destination) {
this.destination = destination;
}
private Date starDate;
public Address getAddress() {
return address;
}
public VehicleDriver getVehicleDriver() {
return vehicleDriver;
}
public void setAddress(Address address) {
this.address = address;
}
public void setVehicleDriver(VehicleDriver vehicleDriver) {
this.vehicleDriver = vehicleDriver;
}
public String getDestination() {
return destination;
}
public void setDestination(String destination) {
this.destination = destination;
}
public Address getAddress() {
return address;
}
public void setAddress(Address address) {
this.address = address;
}
public Date getStarDate() {
return starDate;
}
public void setStarDate(Date starDate) {
this.starDate = starDate;
}
public Date getStarDate() {
return starDate;
}
public void setStarDate(Date starDate) {
this.starDate = starDate;
}
}
@@ -10,27 +10,27 @@ import javax.persistence.ManyToOne;
@DiscriminatorValue("T")
public class Truck extends Vehicle {
private static final long serialVersionUID = 7433386912403859900L;
@ManyToOne
TruckRef truckRef;
private Double capacity;
private static final long serialVersionUID = 7433386912403859900L;
public Double getCapacity() {
return capacity;
}
@ManyToOne
TruckRef truckRef;
public void setCapacity(Double capacity) {
this.capacity = capacity;
}
private Double capacity;
public TruckRef getTruckRef() {
return truckRef;
}
public Double getCapacity() {
return capacity;
}
public void setTruckRef(TruckRef truckRef) {
this.truckRef = truckRef;
}
public void setCapacity(Double capacity) {
this.capacity = capacity;
}
public TruckRef getTruckRef() {
return truckRef;
}
public void setTruckRef(TruckRef truckRef) {
this.truckRef = truckRef;
}
}
@@ -6,25 +6,25 @@ import javax.persistence.Id;
@Entity
public class TruckRef {
@Id
Integer id;
String something;
@Id
Integer id;
public Integer getId() {
return id;
}
String something;
public void setId(Integer id) {
this.id = id;
}
public Integer getId() {
return id;
}
public String getSomething() {
return something;
}
public void setId(Integer id) {
this.id = id;
}
public String getSomething() {
return something;
}
public void setSomething(String something) {
this.something = something;
}
public void setSomething(String something) {
this.something = something;
}
}
@@ -6,72 +6,72 @@ import javax.persistence.Table;
import javax.persistence.Version;
@Entity
@Table(name="ut_detail")
@Table(name = "ut_detail")
public class UTDetail {
@Id
Integer id;
String name;
Integer qty;
Double amount;
@Version
Integer version;
@Id
Integer id;
public UTDetail() {
}
public UTDetail(String name, Integer qty, Double amount) {
this.name = name;
this.qty = qty;
this.amount = amount;
}
public String toString() {
return id+" name:"+name+" qty:"+qty+" amt:"+amount;
}
public Integer getId() {
return id;
}
String name;
public void setId(Integer id) {
this.id = id;
}
Integer qty;
public String getName() {
return name;
}
Double amount;
public void setName(String name) {
this.name = name;
}
@Version
Integer version;
public Integer getQty() {
return qty;
}
public UTDetail() {
}
public void setQty(Integer qty) {
this.qty = qty;
}
public UTDetail(String name, Integer qty, Double amount) {
this.name = name;
this.qty = qty;
this.amount = amount;
}
public Double getAmount() {
return amount;
}
public String toString() {
return id + " name:" + name + " qty:" + qty + " amt:" + amount;
}
public void setAmount(Double amount) {
this.amount = amount;
}
public Integer getId() {
return id;
}
public Integer getVersion() {
return version;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getQty() {
return qty;
}
public void setQty(Integer qty) {
this.qty = qty;
}
public Double getAmount() {
return amount;
}
public void setAmount(Double amount) {
this.amount = amount;
}
public Integer getVersion() {
return version;
}
public void setVersion(Integer version) {
this.version = version;
}
public void setVersion(Integer version) {
this.version = version;
}
}
@@ -2,15 +2,14 @@ package com.avaje.tests.model.basic;
import com.avaje.ebean.Model;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Version;
import java.util.ArrayList;
import java.util.List;
@Entity
@Table(name = "ut_master")
@@ -32,6 +31,7 @@ public class UTMaster extends Model {
public UTMaster() {
}
public UTMaster(String name) {
this.name = name;
}
@@ -1,45 +1,44 @@
package com.avaje.tests.model.basic;
import java.util.UUID;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import java.util.UUID;
@Entity
public class UUTwo {
@Id
UUID id;
String name;
@Id
UUID id;
@ManyToOne(cascade=CascadeType.PERSIST)
UUOne master;
public UUID getId() {
return id;
}
String name;
public void setId(UUID id) {
this.id = id;
}
@ManyToOne(cascade = CascadeType.PERSIST)
UUOne master;
public String getName() {
return name;
}
public UUID getId() {
return id;
}
public void setName(String name) {
this.name = name;
}
public void setId(UUID id) {
this.id = id;
}
public UUOne getMaster() {
return master;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public UUOne getMaster() {
return master;
}
public void setMaster(UUOne master) {
this.master = master;
}
public void setMaster(UUOne master) {
this.master = master;
}
}
@@ -1,46 +1,45 @@
package com.avaje.tests.model.basic;
import java.util.Date;
import javax.persistence.DiscriminatorColumn;
import javax.persistence.Entity;
import javax.persistence.Inheritance;
import java.util.Date;
@Entity
@Inheritance
@DiscriminatorColumn(length = 3)
public abstract class Vehicle extends BasicDomain {
private static final long serialVersionUID = -3060920549470002030L;
private static final long serialVersionUID = -3060920549470002030L;
private String licenseNumber;
private String licenseNumber;
private Date registrationDate;
private Date registrationDate;
// @Transient
private transient String testTransient;
// @Transient
private transient String testTransient;
public String getLicenseNumber() {
return licenseNumber;
}
public String getLicenseNumber() {
return licenseNumber;
}
public void setLicenseNumber(String licenseNumber) {
this.licenseNumber = licenseNumber;
}
public void setLicenseNumber(String licenseNumber) {
this.licenseNumber = licenseNumber;
}
public Date getRegistrationDate() {
return registrationDate;
}
public Date getRegistrationDate() {
return registrationDate;
}
public void setRegistrationDate(Date registrationDate) {
this.registrationDate = registrationDate;
}
public void setRegistrationDate(Date registrationDate) {
this.registrationDate = registrationDate;
}
public String getTestTransient() {
return testTransient;
}
public String getTestTransient() {
return testTransient;
}
public void setTestTransient(String testTransient) {
this.testTransient = testTransient;
}
public void setTestTransient(String testTransient) {
this.testTransient = testTransient;
}
}
@@ -1,55 +1,54 @@
package com.avaje.tests.model.basic;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import java.util.Date;
@Entity
public class VehicleDriver extends BasicDomain {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
private String name;
@ManyToOne(optional=true)
private Vehicle vehicle;
@ManyToOne(optional=true)
private Address address;
private Date licenseIssuedOn;
private String name;
public String getName() {
return name;
}
@ManyToOne(optional = true)
private Vehicle vehicle;
public void setName(String name) {
this.name = name;
}
@ManyToOne(optional = true)
private Address address;
public Vehicle getVehicle() {
return vehicle;
}
private Date licenseIssuedOn;
public void setVehicle(Vehicle vehicle) {
this.vehicle = vehicle;
}
public String getName() {
return name;
}
public Address getAddress() {
return address;
}
public void setName(String name) {
this.name = name;
}
public void setAddress(Address address) {
this.address = address;
}
public Vehicle getVehicle() {
return vehicle;
}
public Date getLicenseIssuedOn() {
return licenseIssuedOn;
}
public void setVehicle(Vehicle vehicle) {
this.vehicle = vehicle;
}
public void setLicenseIssuedOn(Date licenseIssuedOn) {
this.licenseIssuedOn = licenseIssuedOn;
}
public Address getAddress() {
return address;
}
public void setAddress(Address address) {
this.address = address;
}
public Date getLicenseIssuedOn() {
return licenseIssuedOn;
}
public void setLicenseIssuedOn(Date licenseIssuedOn) {
this.licenseIssuedOn = licenseIssuedOn;
}
}