mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-28 15:27:56 +00:00
Organise imports
This commit is contained in:
1 parent
902990e159
commit
21d63c7424
83 files changed
+5188
-5156
No files matched your search
@@ -1,59 +1,60 @@
|
||||
package com.avaje.tests.compositekeys.db;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
package com.avaje.tests.compositekeys.db;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import javax.persistence.Embeddable;
|
||||
|
||||
@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;
|
||||
}
|
||||
}
|
||||
@@ -1,118 +1,127 @@
|
||||
package com.avaje.tests.compositekeys.db;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
||||
@Entity
|
||||
public class Item
|
||||
{
|
||||
@Id
|
||||
private ItemKey key;
|
||||
|
||||
private String description;
|
||||
|
||||
private String units;
|
||||
|
||||
private int type;
|
||||
|
||||
private int region;
|
||||
|
||||
@Embedded
|
||||
@AttributeOverrides({
|
||||
@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
|
||||
@JoinColumns({
|
||||
@JoinColumn(name = "customer", referencedColumnName = "customer", insertable = false, updatable = false),
|
||||
@JoinColumn(name = "type", referencedColumnName = "type", insertable = false, updatable = false)
|
||||
})
|
||||
private Type eType;
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumns({
|
||||
@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;
|
||||
}
|
||||
}
|
||||
package com.avaje.tests.compositekeys.db;
|
||||
|
||||
import javax.persistence.AttributeOverride;
|
||||
import javax.persistence.AttributeOverrides;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Embedded;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.JoinColumns;
|
||||
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
|
||||
@AttributeOverrides({
|
||||
@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
|
||||
@JoinColumns({
|
||||
@JoinColumn(name = "customer", referencedColumnName = "customer", insertable = false, updatable = false),
|
||||
@JoinColumn(name = "type", referencedColumnName = "type", insertable = false, updatable = false)
|
||||
})
|
||||
private Type eType;
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumns({
|
||||
@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;
|
||||
}
|
||||
}
|
||||
@@ -1,63 +1,63 @@
|
||||
package com.avaje.tests.compositekeys.db;
|
||||
|
||||
import javax.persistence.Embeddable;
|
||||
import javax.persistence.Column;
|
||||
|
||||
@Embeddable
|
||||
public class ItemKey
|
||||
{
|
||||
private int customer;
|
||||
|
||||
@Column(name = "itemNumber")
|
||||
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;
|
||||
}
|
||||
}
|
||||
package com.avaje.tests.compositekeys.db;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Embeddable;
|
||||
|
||||
@Embeddable
|
||||
public class ItemKey
|
||||
{
|
||||
private int customer;
|
||||
|
||||
@Column(name = "itemNumber")
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -1,33 +1,35 @@
|
||||
package com.avaje.tests.compositekeys.db;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
||||
@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;
|
||||
}
|
||||
package com.avaje.tests.compositekeys.db;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -1,51 +1,57 @@
|
||||
package com.avaje.tests.compositekeys.db;
|
||||
|
||||
import javax.persistence.*;
|
||||
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;
|
||||
}
|
||||
package com.avaje.tests.compositekeys.db;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.JoinColumns;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.Version;
|
||||
|
||||
@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;
|
||||
}
|
||||
}
|
||||
@@ -1,62 +1,69 @@
|
||||
package com.avaje.tests.compositekeys.db;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.util.List;
|
||||
|
||||
@Entity
|
||||
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;
|
||||
}
|
||||
package com.avaje.tests.compositekeys.db;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
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.Version;
|
||||
|
||||
@Entity
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user