mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-19 23:02:24 +00:00
#2104 - Refactor rename ebean-ddlgen module to ebean-ddl-generator
This commit is contained in:
1 parent
e5b0b31da6
commit
6ecd849499
418 files changed
+59
-59
No files matched your search
@@ -0,0 +1,59 @@
|
||||
package org.tests.model;
|
||||
|
||||
import io.ebean.Model;
|
||||
import io.ebean.annotation.WhenCreated;
|
||||
import io.ebean.annotation.WhenModified;
|
||||
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.MappedSuperclass;
|
||||
import javax.persistence.Version;
|
||||
import java.sql.Timestamp;
|
||||
|
||||
@MappedSuperclass
|
||||
public class BaseModel extends Model {
|
||||
|
||||
@Id
|
||||
Long id;
|
||||
|
||||
@Version
|
||||
Long version;
|
||||
|
||||
@WhenCreated
|
||||
Timestamp whenCreated;
|
||||
|
||||
@WhenModified
|
||||
Timestamp whenModified;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(Long version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public Timestamp getWhenCreated() {
|
||||
return whenCreated;
|
||||
}
|
||||
|
||||
public void setWhenCreated(Timestamp whenCreated) {
|
||||
this.whenCreated = whenCreated;
|
||||
}
|
||||
|
||||
public Timestamp getWhenModified() {
|
||||
return whenModified;
|
||||
}
|
||||
|
||||
public void setWhenModified(Timestamp whenModified) {
|
||||
this.whenModified = whenModified;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,129 @@
|
||||
package org.tests.model.basic;
|
||||
|
||||
import io.ebean.annotation.InvalidateQueryCache;
|
||||
import org.tests.model.metaannotation.SizeMedium;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Version;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.sql.Timestamp;
|
||||
|
||||
/**
|
||||
* Address entity bean.
|
||||
*/
|
||||
// Address is not L2 cached directly but it is joined to queries that are cached
|
||||
// What InvalidateQueryCache means is that we propagate a table modification event
|
||||
// when address is changed ... and cached queries that join to address will be
|
||||
// invalidated accordingly.
|
||||
@InvalidateQueryCache
|
||||
@Entity
|
||||
@Table(name = "o_address")
|
||||
public class Address {
|
||||
|
||||
@Id
|
||||
Integer id;
|
||||
|
||||
@Size(max = 100)
|
||||
@Column(name = "line_1")
|
||||
String line1;
|
||||
|
||||
@SizeMedium
|
||||
@Column(name = "line_2")
|
||||
String line2;
|
||||
|
||||
@SizeMedium
|
||||
String city;
|
||||
|
||||
Timestamp cretime;
|
||||
|
||||
@Version
|
||||
Timestamp updtime;
|
||||
|
||||
/**
|
||||
* Return id.
|
||||
*/
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set id.
|
||||
*/
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return line 1.
|
||||
*/
|
||||
public String getLine1() {
|
||||
return line1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set line 1.
|
||||
*/
|
||||
public void setLine1(String line1) {
|
||||
this.line1 = line1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return line 2.
|
||||
*/
|
||||
public String getLine2() {
|
||||
return line2;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set line 2.
|
||||
*/
|
||||
public void setLine2(String line2) {
|
||||
this.line2 = line2;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return city.
|
||||
*/
|
||||
public String getCity() {
|
||||
return city;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set city.
|
||||
*/
|
||||
public void setCity(String city) {
|
||||
this.city = city;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return cretime.
|
||||
*/
|
||||
public Timestamp getCretime() {
|
||||
return cretime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set cretime.
|
||||
*/
|
||||
public void setCretime(Timestamp cretime) {
|
||||
this.cretime = cretime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return updtime.
|
||||
*/
|
||||
public Timestamp getUpdtime() {
|
||||
return updtime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set updtime.
|
||||
*/
|
||||
public void setUpdtime(Timestamp updtime) {
|
||||
this.updtime = updtime;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package org.tests.model.basic;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
|
||||
@Entity
|
||||
public class CKeyAssoc {
|
||||
|
||||
@Id
|
||||
Integer id;
|
||||
|
||||
String assocOne;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getAssocOne() {
|
||||
return assocOne;
|
||||
}
|
||||
|
||||
public void setAssocOne(String assocOne) {
|
||||
this.assocOne = assocOne;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package org.tests.model.basic;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.ManyToOne;
|
||||
|
||||
@Entity
|
||||
public class CKeyDetail {
|
||||
|
||||
@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;
|
||||
|
||||
public CKeyDetail() {
|
||||
|
||||
}
|
||||
|
||||
public CKeyDetail(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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package org.tests.model.basic;
|
||||
|
||||
import io.ebean.annotation.Cache;
|
||||
|
||||
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
|
||||
@Cache
|
||||
public class CKeyParent {
|
||||
|
||||
@EmbeddedId
|
||||
CKeyParentId id;
|
||||
|
||||
String name;
|
||||
|
||||
@Version
|
||||
int version;
|
||||
|
||||
@ManyToOne(cascade = CascadeType.PERSIST)
|
||||
CKeyAssoc assoc;
|
||||
|
||||
@OneToMany(cascade = CascadeType.PERSIST, mappedBy = "parent")
|
||||
List<CKeyDetail> details;
|
||||
|
||||
public CKeyParentId getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(CKeyParentId id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
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<>();
|
||||
}
|
||||
details.add(detail);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package org.tests.model.basic;
|
||||
|
||||
import javax.persistence.Embeddable;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
@Embeddable
|
||||
public class CKeyParentId {
|
||||
|
||||
Integer oneKey;
|
||||
@Size(max = 127)
|
||||
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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (!(o instanceof CKeyParentId)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package org.tests.model.basic;
|
||||
|
||||
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;
|
||||
|
||||
@Entity(name = "Person")
|
||||
@Table(name = "PERSONS")
|
||||
public class Person implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 495045977245770183L;
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = javax.persistence.GenerationType.AUTO)
|
||||
@SequenceGenerator(name = "PERSONS_SEQ", initialValue = 1000, allocationSize = 40)
|
||||
@Column(name = "ID", unique = true, nullable = false)
|
||||
private Long id;
|
||||
|
||||
@Column(name = "SURNAME", nullable = false, unique = false, columnDefinition = "varchar(64)")
|
||||
private String surname;
|
||||
|
||||
@Column(name = "NAME", nullable = false, unique = false, columnDefinition = "varchar(64)")
|
||||
private String name;
|
||||
|
||||
@OneToMany(targetEntity = Phone.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "person")
|
||||
private List<Phone> phones;
|
||||
|
||||
public Person() {
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getSurname() {
|
||||
return surname;
|
||||
}
|
||||
|
||||
public void setSurname(String surname) {
|
||||
this.surname = surname;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public List<Phone> getPhones() {
|
||||
return phones;
|
||||
}
|
||||
|
||||
public void setPhones(List<Phone> phones) {
|
||||
this.phones = phones;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package org.tests.model.basic;
|
||||
|
||||
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.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;
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = javax.persistence.GenerationType.AUTO)
|
||||
@Column(name = "id", unique = true, nullable = false)
|
||||
private Long id;
|
||||
|
||||
@Column(name = "phone_number", nullable = false, unique = true, columnDefinition = "varchar(7)")
|
||||
private String phoneNumber;
|
||||
|
||||
@ManyToOne(targetEntity = Person.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "person_id", nullable = false)
|
||||
private Person person;
|
||||
|
||||
public Phone() {
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getPhoneNumber() {
|
||||
return phoneNumber;
|
||||
}
|
||||
|
||||
public void setPhoneNumber(String phoneNumber) {
|
||||
this.phoneNumber = phoneNumber;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Person getPerson() {
|
||||
return person;
|
||||
}
|
||||
|
||||
public void setPerson(Person person) {
|
||||
this.person = person;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package org.tests.model.basic;
|
||||
|
||||
import io.ebean.annotation.DbEnumValue;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.DiscriminatorValue;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Inheritance;
|
||||
import javax.persistence.ManyToOne;
|
||||
|
||||
@Entity
|
||||
@Inheritance
|
||||
@DiscriminatorValue("T")
|
||||
public class Truck extends Vehicle {
|
||||
private static final long serialVersionUID = 9195535931523211134L;
|
||||
|
||||
public enum Size {
|
||||
SMALL("S"),
|
||||
MEDIUM("M"),
|
||||
LARGE("L"),
|
||||
HUGE("H");
|
||||
|
||||
String value;
|
||||
|
||||
Size(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@DbEnumValue(length = 3)
|
||||
public String value() {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
@Column(name = "siz")
|
||||
private Size size;
|
||||
|
||||
@ManyToOne
|
||||
TruckRef truckRef;
|
||||
|
||||
private Double capacity;
|
||||
|
||||
public Double getCapacity() {
|
||||
return capacity;
|
||||
}
|
||||
|
||||
public void setCapacity(Double capacity) {
|
||||
this.capacity = capacity;
|
||||
}
|
||||
|
||||
public TruckRef getTruckRef() {
|
||||
return truckRef;
|
||||
}
|
||||
|
||||
public void setTruckRef(TruckRef truckRef) {
|
||||
this.truckRef = truckRef;
|
||||
}
|
||||
|
||||
public Size getSize() {
|
||||
return size;
|
||||
}
|
||||
|
||||
public void setSize(Size size) {
|
||||
this.size = size;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package org.tests.model.basic;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
|
||||
@Entity
|
||||
public class TruckRef {
|
||||
|
||||
@Id
|
||||
Integer id;
|
||||
|
||||
String 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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package org.tests.model.basic;
|
||||
|
||||
import org.tests.model.BaseModel;
|
||||
|
||||
import javax.persistence.DiscriminatorColumn;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Inheritance;
|
||||
import javax.persistence.ManyToOne;
|
||||
import java.util.Date;
|
||||
|
||||
@Entity
|
||||
@Inheritance
|
||||
@DiscriminatorColumn(length = 3)
|
||||
public abstract class Vehicle extends BaseModel {
|
||||
|
||||
private String licenseNumber;
|
||||
|
||||
private Date registrationDate;
|
||||
|
||||
// @Transient
|
||||
private transient String testTransient;
|
||||
|
||||
@ManyToOne
|
||||
private VehicleLease lease;
|
||||
|
||||
public String getLicenseNumber() {
|
||||
return licenseNumber;
|
||||
}
|
||||
|
||||
public void setLicenseNumber(String licenseNumber) {
|
||||
this.licenseNumber = licenseNumber;
|
||||
}
|
||||
|
||||
public Date getRegistrationDate() {
|
||||
return registrationDate;
|
||||
}
|
||||
|
||||
public void setRegistrationDate(Date registrationDate) {
|
||||
this.registrationDate = registrationDate;
|
||||
}
|
||||
|
||||
public String getTestTransient() {
|
||||
return testTransient;
|
||||
}
|
||||
|
||||
public void setTestTransient(String testTransient) {
|
||||
this.testTransient = testTransient;
|
||||
}
|
||||
|
||||
public VehicleLease getLease() {
|
||||
return lease;
|
||||
}
|
||||
|
||||
public void setLease(VehicleLease lease) {
|
||||
this.lease = lease;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package org.tests.model.basic;
|
||||
|
||||
import org.tests.model.BaseModel;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.ManyToOne;
|
||||
import java.util.Date;
|
||||
|
||||
@Entity
|
||||
public class VehicleDriver extends BaseModel {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String name;
|
||||
|
||||
@ManyToOne(optional = true)
|
||||
private Vehicle vehicle;
|
||||
|
||||
@ManyToOne(optional = true)
|
||||
private Address address;
|
||||
|
||||
private Date licenseIssuedOn;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Vehicle getVehicle() {
|
||||
return vehicle;
|
||||
}
|
||||
|
||||
public void setVehicle(Vehicle vehicle) {
|
||||
this.vehicle = vehicle;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package org.tests.model.basic;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Inheritance;
|
||||
import javax.persistence.Version;
|
||||
import java.time.LocalDate;
|
||||
|
||||
@Entity
|
||||
@Inheritance
|
||||
public abstract class VehicleLease {
|
||||
|
||||
@Id
|
||||
long id;
|
||||
|
||||
String name;
|
||||
|
||||
LocalDate activeStart;
|
||||
|
||||
LocalDate activeEnd;
|
||||
|
||||
@Version
|
||||
long version;
|
||||
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public long getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(long version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public LocalDate getActiveStart() {
|
||||
return activeStart;
|
||||
}
|
||||
|
||||
public void setActiveStart(LocalDate activeStart) {
|
||||
this.activeStart = activeStart;
|
||||
}
|
||||
|
||||
public LocalDate getActiveEnd() {
|
||||
return activeEnd;
|
||||
}
|
||||
|
||||
public void setActiveEnd(LocalDate activeEnd) {
|
||||
this.activeEnd = activeEnd;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package org.tests.model.basic;
|
||||
|
||||
import javax.persistence.DiscriminatorValue;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Inheritance;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Entity
|
||||
@Inheritance
|
||||
@DiscriminatorValue("LONG")
|
||||
public class VehicleLeaseLong extends VehicleLease {
|
||||
|
||||
BigDecimal bond;
|
||||
|
||||
int minDuration;
|
||||
|
||||
public BigDecimal getBond() {
|
||||
return bond;
|
||||
}
|
||||
|
||||
public void setBond(BigDecimal bond) {
|
||||
this.bond = bond;
|
||||
}
|
||||
|
||||
public int getMinDuration() {
|
||||
return minDuration;
|
||||
}
|
||||
|
||||
public void setMinDuration(int minDuration) {
|
||||
this.minDuration = minDuration;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package org.tests.model.basic;
|
||||
|
||||
import javax.persistence.DiscriminatorValue;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Inheritance;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Entity
|
||||
@Inheritance
|
||||
@DiscriminatorValue("SHORT")
|
||||
public class VehicleLeaseShort extends VehicleLease {
|
||||
|
||||
|
||||
BigDecimal dayRate;
|
||||
|
||||
Integer maxDays;
|
||||
|
||||
public BigDecimal getDayRate() {
|
||||
return dayRate;
|
||||
}
|
||||
|
||||
public void setDayRate(BigDecimal dayRate) {
|
||||
this.dayRate = dayRate;
|
||||
}
|
||||
|
||||
public Integer getMaxDays() {
|
||||
return maxDays;
|
||||
}
|
||||
|
||||
public void setMaxDays(Integer maxDays) {
|
||||
this.maxDays = maxDays;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package org.tests.model.compositekeys;
|
||||
|
||||
import javax.persistence.Embeddable;
|
||||
import java.util.Date;
|
||||
|
||||
@Embeddable
|
||||
public class AuditInfo {
|
||||
private Date lastUpdated;
|
||||
private Date created;
|
||||
private String updatedBy;
|
||||
private String createdBy;
|
||||
|
||||
public AuditInfo() {
|
||||
created = new Date();
|
||||
createdBy = "dummy";
|
||||
}
|
||||
|
||||
public Date getLastUpdated() {
|
||||
return lastUpdated;
|
||||
}
|
||||
|
||||
public void setLastUpdated(Date lastUpdated) {
|
||||
this.lastUpdated = lastUpdated;
|
||||
}
|
||||
|
||||
public Date getCreated() {
|
||||
return created;
|
||||
}
|
||||
|
||||
public void setCreated(Date created) {
|
||||
this.created = created;
|
||||
}
|
||||
|
||||
public String getUpdatedBy() {
|
||||
return updatedBy;
|
||||
}
|
||||
|
||||
public void setUpdatedBy(String updatedBy) {
|
||||
this.updatedBy = updatedBy;
|
||||
}
|
||||
|
||||
public String getCreatedBy() {
|
||||
return createdBy;
|
||||
}
|
||||
|
||||
public void setCreatedBy(String createdBy) {
|
||||
this.createdBy = createdBy;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
package org.tests.model.compositekeys;
|
||||
|
||||
import javax.persistence.AttributeOverride;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Embedded;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.Version;
|
||||
|
||||
@Entity
|
||||
public class Item {
|
||||
@Id
|
||||
private ItemKey key;
|
||||
|
||||
private String description;
|
||||
|
||||
private String units;
|
||||
|
||||
private int type;
|
||||
|
||||
private int region;
|
||||
|
||||
@Embedded
|
||||
@AttributeOverride(name = "lastUpdated", column = @Column(name = "date_modified"))
|
||||
@AttributeOverride(name = "created", column = @Column(name = "date_created"))
|
||||
@AttributeOverride(name = "updatedBy", column = @Column(name = "modified_by"))
|
||||
@AttributeOverride(name = "createdBy", column = @Column(name = "created_by"))
|
||||
private AuditInfo auditInfo = new AuditInfo();
|
||||
|
||||
@Version
|
||||
private Long version;
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "customer", referencedColumnName = "customer", insertable = false, updatable = false)
|
||||
@JoinColumn(name = "type", referencedColumnName = "type", insertable = false, updatable = false)
|
||||
private Type eType;
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "customer", referencedColumnName = "customer", insertable = false, updatable = false)
|
||||
@JoinColumn(name = "region", referencedColumnName = "type", insertable = false, updatable = false)
|
||||
private Region eRegion;
|
||||
|
||||
public ItemKey getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public void setKey(ItemKey key) {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public String getUnits() {
|
||||
return units;
|
||||
}
|
||||
|
||||
public void setUnits(String units) {
|
||||
this.units = units;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public int getRegion() {
|
||||
return region;
|
||||
}
|
||||
|
||||
public void setRegion(int region) {
|
||||
this.region = region;
|
||||
}
|
||||
|
||||
public Long getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public Type getEType() {
|
||||
return eType;
|
||||
}
|
||||
|
||||
public Region getERegion() {
|
||||
return eRegion;
|
||||
}
|
||||
|
||||
public void setVersion(Long version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public void setEType(Type eType) {
|
||||
this.eType = eType;
|
||||
}
|
||||
|
||||
public void setERegion(Region eRegion) {
|
||||
this.eRegion = eRegion;
|
||||
}
|
||||
|
||||
public AuditInfo getAuditInfo() {
|
||||
return auditInfo;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package org.tests.model.compositekeys;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Embeddable;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
|
||||
@Embeddable
|
||||
public class ItemKey {
|
||||
|
||||
private int customer;
|
||||
|
||||
@Column(name = "itemnumber")
|
||||
@Size(max = 127)
|
||||
private String itemNumber;
|
||||
|
||||
public int getCustomer() {
|
||||
return customer;
|
||||
}
|
||||
|
||||
public void setCustomer(int customer) {
|
||||
this.customer = customer;
|
||||
}
|
||||
|
||||
public String getItemNumber() {
|
||||
return itemNumber;
|
||||
}
|
||||
|
||||
public void setItemNumber(String itemNumber) {
|
||||
this.itemNumber = itemNumber;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (!(o instanceof ItemKey)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
ItemKey itemKey = (ItemKey) o;
|
||||
|
||||
if (customer != itemKey.customer) {
|
||||
return false;
|
||||
}
|
||||
if (!itemNumber.equals(itemKey.itemNumber)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = customer;
|
||||
result = 31 * result + itemNumber.hashCode();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package org.tests.model.compositekeys;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
|
||||
@Entity
|
||||
public class Parcel {
|
||||
@Id
|
||||
@Column(name = "parcelid")
|
||||
private Long parcelId;
|
||||
|
||||
private String description;
|
||||
|
||||
public Long getParcelId() {
|
||||
return parcelId;
|
||||
}
|
||||
|
||||
public void setParcelId(Long parcelId) {
|
||||
this.parcelId = parcelId;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package org.tests.model.compositekeys;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.OneToOne;
|
||||
|
||||
@Entity
|
||||
public class ParcelLocation {
|
||||
@Id
|
||||
@Column(name = "parcellocid")
|
||||
private Long parcelLocId;
|
||||
|
||||
private String location;
|
||||
|
||||
@OneToOne
|
||||
@JoinColumn(name = "parcelid", referencedColumnName = "parcelid")
|
||||
private Parcel parcel;
|
||||
|
||||
public Long getParcelLocId() {
|
||||
return parcelLocId;
|
||||
}
|
||||
|
||||
public void setParcelLocId(Long parcelLocId) {
|
||||
this.parcelLocId = parcelLocId;
|
||||
}
|
||||
|
||||
public String getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
public void setLocation(String location) {
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
|
||||
public Parcel getParcel() {
|
||||
return parcel;
|
||||
}
|
||||
|
||||
public void setParcel(Parcel parcel) {
|
||||
this.parcel = parcel;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package org.tests.model.compositekeys;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.JoinColumns;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.Version;
|
||||
import java.util.List;
|
||||
|
||||
@Entity
|
||||
public class Region {
|
||||
@Id
|
||||
private RegionKey key;
|
||||
|
||||
private String description;
|
||||
|
||||
@Version
|
||||
private Long version;
|
||||
|
||||
@OneToMany
|
||||
@JoinColumns({
|
||||
@JoinColumn(name = "customer", referencedColumnName = "customer", insertable = false, updatable = false),
|
||||
@JoinColumn(name = "region", referencedColumnName = "type", insertable = false, updatable = false)
|
||||
})
|
||||
private List<Item> items;
|
||||
|
||||
public RegionKey getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public void setKey(RegionKey key) {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public Long getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(Long version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public List<Item> getItems() {
|
||||
return items;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package org.tests.model.compositekeys;
|
||||
|
||||
import javax.persistence.Embeddable;
|
||||
|
||||
@Embeddable
|
||||
public class RegionKey {
|
||||
private int customer;
|
||||
|
||||
private int type;
|
||||
|
||||
public int getCustomer() {
|
||||
return customer;
|
||||
}
|
||||
|
||||
public void setCustomer(int customer) {
|
||||
this.customer = customer;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hc = 31 * 7 + customer;
|
||||
hc = 31 * hc + type;
|
||||
return hc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o instanceof RegionKey) {
|
||||
RegionKey k = (RegionKey) o;
|
||||
return k.customer == customer && k.type == type;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package org.tests.model.compositekeys;
|
||||
|
||||
import io.ebean.annotation.Identity;
|
||||
|
||||
import javax.persistence.EmbeddedId;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Version;
|
||||
|
||||
import static io.ebean.annotation.IdentityGenerated.BY_DEFAULT;
|
||||
|
||||
@Identity(generated = BY_DEFAULT)
|
||||
@Entity
|
||||
public class SubType {
|
||||
@EmbeddedId
|
||||
private SubTypeKey key;
|
||||
|
||||
private String description;
|
||||
|
||||
@Version
|
||||
private Long version;
|
||||
|
||||
public SubTypeKey getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public void setKey(SubTypeKey key) {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public Long getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(Long version) {
|
||||
this.version = version;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package org.tests.model.compositekeys;
|
||||
|
||||
import javax.persistence.Embeddable;
|
||||
|
||||
@Embeddable
|
||||
public class SubTypeKey {
|
||||
private int subTypeId;
|
||||
|
||||
public int getSubTypeId() {
|
||||
return subTypeId;
|
||||
}
|
||||
|
||||
public void setSubTypeId(int subTypeId) {
|
||||
this.subTypeId = subTypeId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return 31 * 7 + subTypeId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (!(o instanceof SubTypeKey)) {
|
||||
return false;
|
||||
}
|
||||
return subTypeId == ((SubTypeKey) o).subTypeId;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package org.tests.model.compositekeys;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.JoinColumns;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Version;
|
||||
import java.util.List;
|
||||
|
||||
@Entity
|
||||
@Table(name="`type`") // needs to be quoted because it's a keyword on HANA
|
||||
public class Type {
|
||||
@Id
|
||||
private TypeKey key;
|
||||
|
||||
private String description;
|
||||
|
||||
@Version
|
||||
private Long version;
|
||||
|
||||
@OneToMany
|
||||
@JoinColumns({
|
||||
@JoinColumn(name = "customer", referencedColumnName = "customer", insertable = false, updatable = false),
|
||||
@JoinColumn(name = "type", referencedColumnName = "type", insertable = false, updatable = false)
|
||||
})
|
||||
private List<Item> items;
|
||||
|
||||
@ManyToOne
|
||||
private SubType subType;
|
||||
|
||||
public TypeKey getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public void setKey(TypeKey key) {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public Long getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(Long version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public List<Item> getItems() {
|
||||
return items;
|
||||
}
|
||||
|
||||
public SubType getSubType() {
|
||||
return subType;
|
||||
}
|
||||
|
||||
public void setSubType(SubType subType) {
|
||||
this.subType = subType;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package org.tests.model.compositekeys;
|
||||
|
||||
import javax.persistence.Embeddable;
|
||||
|
||||
@Embeddable
|
||||
public class TypeKey {
|
||||
private int customer;
|
||||
|
||||
private int type;
|
||||
|
||||
public int getCustomer() {
|
||||
return customer;
|
||||
}
|
||||
|
||||
public void setCustomer(int customer) {
|
||||
this.customer = customer;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hc = 31 + customer;
|
||||
hc = hc * 31 + type;
|
||||
return hc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o instanceof TypeKey) {
|
||||
TypeKey k = (TypeKey) o;
|
||||
return k.customer == customer && k.type == type;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package org.tests.model.converstation;
|
||||
|
||||
import io.ebean.annotation.FetchPreference;
|
||||
import org.tests.model.BaseModel;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.Table;
|
||||
import java.util.List;
|
||||
|
||||
@Entity
|
||||
@Table(name = "c_conversation")
|
||||
public class Conversation extends BaseModel {
|
||||
|
||||
String title;
|
||||
|
||||
@Column(name = "isopen")
|
||||
boolean open;
|
||||
|
||||
@ManyToOne
|
||||
Group group;
|
||||
|
||||
@FetchPreference(1)
|
||||
@OneToMany(mappedBy = "conversation")
|
||||
List<Participation> participants;
|
||||
|
||||
@FetchPreference(2)
|
||||
@OneToMany(mappedBy = "conversation")
|
||||
List<Message> messages;
|
||||
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public boolean isOpen() {
|
||||
return open;
|
||||
}
|
||||
|
||||
public void setOpen(boolean open) {
|
||||
this.open = open;
|
||||
}
|
||||
|
||||
public Group getGroup() {
|
||||
return group;
|
||||
}
|
||||
|
||||
public void setGroup(Group group) {
|
||||
this.group = group;
|
||||
}
|
||||
|
||||
public List<Message> getMessages() {
|
||||
return messages;
|
||||
}
|
||||
|
||||
public void setMessages(List<Message> messages) {
|
||||
this.messages = messages;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package org.tests.model.converstation;
|
||||
|
||||
import org.tests.model.BaseModel;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.Table;
|
||||
import java.util.List;
|
||||
|
||||
@Entity
|
||||
@Table(name = "c_group")
|
||||
public class Group extends BaseModel {
|
||||
|
||||
boolean inactive;
|
||||
|
||||
String name;
|
||||
|
||||
@OneToMany(mappedBy = "group")
|
||||
List<User> users;
|
||||
|
||||
public boolean isInactive() {
|
||||
return inactive;
|
||||
}
|
||||
|
||||
public void setInactive(boolean inactive) {
|
||||
this.inactive = inactive;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public List<User> getUsers() {
|
||||
return users;
|
||||
}
|
||||
|
||||
public void setUsers(List<User> users) {
|
||||
this.users = users;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package org.tests.model.converstation;
|
||||
|
||||
import org.tests.model.BaseModel;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@Entity
|
||||
@Table(name = "c_message")
|
||||
public class Message extends BaseModel {
|
||||
|
||||
String title;
|
||||
|
||||
String body;
|
||||
|
||||
@ManyToOne
|
||||
Conversation conversation;
|
||||
|
||||
@ManyToOne
|
||||
User user;
|
||||
|
||||
|
||||
public Conversation getConversation() {
|
||||
return conversation;
|
||||
}
|
||||
|
||||
public void setConversation(Conversation conversation) {
|
||||
this.conversation = conversation;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getBody() {
|
||||
return body;
|
||||
}
|
||||
|
||||
public void setBody(String body) {
|
||||
this.body = body;
|
||||
}
|
||||
|
||||
public User getUser() {
|
||||
return user;
|
||||
}
|
||||
|
||||
public void setUser(User user) {
|
||||
this.user = user;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package org.tests.model.converstation;
|
||||
|
||||
import org.tests.model.BaseModel;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@Entity
|
||||
@Table(name = "c_participation")
|
||||
public class Participation extends BaseModel {
|
||||
|
||||
public enum Type {
|
||||
Moderator,
|
||||
Member
|
||||
}
|
||||
|
||||
Integer rating;
|
||||
|
||||
Type type;
|
||||
|
||||
@ManyToOne(optional = false)
|
||||
Conversation conversation;
|
||||
|
||||
@ManyToOne(optional = false)
|
||||
User user;
|
||||
|
||||
public Conversation getConversation() {
|
||||
return conversation;
|
||||
}
|
||||
|
||||
public void setConversation(Conversation conversation) {
|
||||
this.conversation = conversation;
|
||||
}
|
||||
|
||||
public Type getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(Type type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public Integer getRating() {
|
||||
return rating;
|
||||
}
|
||||
|
||||
public void setRating(Integer rating) {
|
||||
this.rating = rating;
|
||||
}
|
||||
|
||||
public User getUser() {
|
||||
return user;
|
||||
}
|
||||
|
||||
public void setUser(User user) {
|
||||
this.user = user;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package org.tests.model.converstation;
|
||||
|
||||
import io.ebean.annotation.History;
|
||||
import io.ebean.annotation.HistoryExclude;
|
||||
import org.tests.model.BaseModel;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@History
|
||||
@Entity
|
||||
@Table(name = "c_user")
|
||||
public class User extends BaseModel {
|
||||
|
||||
boolean inactive;
|
||||
|
||||
String name;
|
||||
|
||||
String email;
|
||||
|
||||
@HistoryExclude
|
||||
String passwordHash;
|
||||
|
||||
@ManyToOne
|
||||
Group group;
|
||||
|
||||
public User() {
|
||||
}
|
||||
|
||||
public boolean isInactive() {
|
||||
return inactive;
|
||||
}
|
||||
|
||||
public void setInactive(boolean inactive) {
|
||||
this.inactive = inactive;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public Group getGroup() {
|
||||
return group;
|
||||
}
|
||||
|
||||
public void setGroup(Group group) {
|
||||
this.group = group;
|
||||
}
|
||||
|
||||
public String getPasswordHash() {
|
||||
return passwordHash;
|
||||
}
|
||||
|
||||
public void setPasswordHash(String passwordHash) {
|
||||
this.passwordHash = passwordHash;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package org.tests.model.metaannotation;
|
||||
|
||||
import javax.validation.constraints.Size;
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* Meta-Annotation that defines @Size(max=100)
|
||||
*
|
||||
* @author Roland Praml, FOCONIS AG
|
||||
*/
|
||||
@Target(ElementType.FIELD)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@Size(max = 100)
|
||||
public @interface SizeMedium {
|
||||
}
|
||||
Reference in new issue
Block a user