mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
FIX: Splitcolumns must return an empty array if string was empty (#1315)
* Add test suite from rpraml * FIX: Splitcolumns must return an empty array if string was empty * Just the reference scripts
This commit is contained in:
committed by
Rob Bygrave
parent
0e1c815826
commit
b642b3c644
@@ -0,0 +1,32 @@
|
||||
package misc.migration.v1_0;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@Entity
|
||||
@Table(name = "migtest_ckey_assoc")
|
||||
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,41 @@
|
||||
package misc.migration.v1_0;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@Entity
|
||||
@Table(name = "migtest_ckey_detail")
|
||||
public class CKeyDetail {
|
||||
|
||||
@Id
|
||||
Integer id;
|
||||
|
||||
String something;
|
||||
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package misc.migration.v1_0;
|
||||
|
||||
import javax.persistence.EmbeddedId;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Version;
|
||||
|
||||
@Entity
|
||||
@Table(name = "migtest_ckey_parent")
|
||||
public class CKeyParent {
|
||||
|
||||
@EmbeddedId
|
||||
CKeyParentId id;
|
||||
|
||||
String name;
|
||||
|
||||
@Version
|
||||
int version;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package misc.migration.v1_0;
|
||||
|
||||
import javax.persistence.Embeddable;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
@Embeddable
|
||||
public class CKeyParentId {
|
||||
|
||||
@Size(max=127)
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,10 @@ import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.Table;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import io.ebean.annotation.Index;
|
||||
import io.ebean.annotation.NotNull;
|
||||
|
||||
@Entity
|
||||
@Table(name = "migtest_e_ref")
|
||||
@@ -16,4 +20,9 @@ public class ERef {
|
||||
|
||||
@OneToMany
|
||||
List<EBasic> basics;
|
||||
|
||||
@NotNull
|
||||
@Index(unique = true)
|
||||
@Size(max=127)
|
||||
String name;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package misc.migration.v1_0;
|
||||
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@Entity
|
||||
@Table(name = "migtest_mtm_c")
|
||||
public class MtmChild {
|
||||
|
||||
@Id
|
||||
Integer id;
|
||||
|
||||
String name;
|
||||
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package misc.migration.v1_0;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@Entity
|
||||
@Table(name = "migtest_mtm_m")
|
||||
public class MtmMaster {
|
||||
|
||||
@Id
|
||||
Long id;
|
||||
|
||||
String name;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package misc.migration.v1_0;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@Entity
|
||||
@Table(name = "migtest_oto_child")
|
||||
public class OtoChild {
|
||||
|
||||
@Id
|
||||
Integer id;
|
||||
|
||||
String name;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package misc.migration.v1_0;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@Entity
|
||||
@Table(name = "migtest_oto_master")
|
||||
public class OtoMaster {
|
||||
|
||||
@Id
|
||||
Long id;
|
||||
|
||||
String name;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package misc.migration.v1_1;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@Entity
|
||||
@Table(name = "migtest_ckey_assoc")
|
||||
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,57 @@
|
||||
package misc.migration.v1_1;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@Entity
|
||||
@Table(name = "migtest_ckey_detail")
|
||||
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,78 @@
|
||||
package misc.migration.v1_1;
|
||||
|
||||
import javax.persistence.CascadeType;
|
||||
import javax.persistence.EmbeddedId;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Version;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Entity
|
||||
@Table(name = "migtest_ckey_parent")
|
||||
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,60 @@
|
||||
package misc.migration.v1_1;
|
||||
|
||||
import javax.persistence.Embeddable;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
@Embeddable
|
||||
public class CKeyParentId {
|
||||
|
||||
@Size(max=127)
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -17,6 +17,7 @@ import java.sql.Timestamp;
|
||||
|
||||
@Entity
|
||||
@Table(name = "migtest_e_basic")
|
||||
@Index(columnNames = { "status" , "indextest1"}, unique = true)
|
||||
public class EBasic {
|
||||
|
||||
public enum Status {
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
package misc.migration.v1_1;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.ManyToMany;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@Entity
|
||||
@Table(name = "migtest_mtm_c")
|
||||
public class MtmChild {
|
||||
|
||||
@Id
|
||||
Integer id;
|
||||
|
||||
String name;
|
||||
|
||||
@ManyToMany
|
||||
List<MtmMaster> masters;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public List<MtmMaster> getMasters() {
|
||||
return masters;
|
||||
}
|
||||
|
||||
public void setMasters(List<MtmMaster> masters) {
|
||||
this.masters = masters;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package misc.migration.v1_1;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.ManyToMany;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@Entity
|
||||
@Table(name = "migtest_mtm_m")
|
||||
public class MtmMaster {
|
||||
|
||||
@Id
|
||||
Long id;
|
||||
|
||||
String name;
|
||||
|
||||
@ManyToMany
|
||||
List<MtmChild> children;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public List<MtmChild> getChildren() {
|
||||
return children;
|
||||
}
|
||||
|
||||
public void setChildren(List<MtmChild> children) {
|
||||
this.children = children;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package misc.migration.v1_1;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.OneToOne;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@Entity
|
||||
@Table(name = "migtest_oto_child")
|
||||
public class OtoChild {
|
||||
|
||||
@Id
|
||||
Integer id;
|
||||
|
||||
String name;
|
||||
|
||||
@OneToOne
|
||||
OtoMaster master;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public OtoMaster getMaster() {
|
||||
return master;
|
||||
}
|
||||
|
||||
public void setMaster(OtoMaster master) {
|
||||
this.master = master;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package misc.migration.v1_1;
|
||||
|
||||
import javax.persistence.CascadeType;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.OneToOne;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@Entity
|
||||
@Table(name = "migtest_oto_master")
|
||||
public class OtoMaster {
|
||||
|
||||
@Id
|
||||
Long id;
|
||||
|
||||
String name;
|
||||
|
||||
@OneToOne(cascade = CascadeType.ALL, mappedBy = "master")
|
||||
OtoChild child;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public OtoChild getChild() {
|
||||
return child;
|
||||
}
|
||||
|
||||
public void setChild(OtoChild child) {
|
||||
this.child = child;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package misc.migration.v1_2;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@Entity
|
||||
@Table(name = "migtest_ckey_assoc")
|
||||
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,41 @@
|
||||
package misc.migration.v1_2;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@Entity
|
||||
@Table(name = "migtest_ckey_detail")
|
||||
public class CKeyDetail {
|
||||
|
||||
@Id
|
||||
Integer id;
|
||||
|
||||
String something;
|
||||
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package misc.migration.v1_2;
|
||||
|
||||
import javax.persistence.EmbeddedId;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Version;
|
||||
|
||||
@Entity
|
||||
@Table(name = "migtest_ckey_parent")
|
||||
public class CKeyParent {
|
||||
|
||||
@EmbeddedId
|
||||
CKeyParentId id;
|
||||
|
||||
String name;
|
||||
|
||||
@Version
|
||||
int version;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package misc.migration.v1_2;
|
||||
|
||||
import javax.persistence.Embeddable;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
@Embeddable
|
||||
public class CKeyParentId {
|
||||
|
||||
@Size(max=127)
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,10 @@ import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.Table;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import io.ebean.annotation.Index;
|
||||
import io.ebean.annotation.NotNull;
|
||||
|
||||
@Entity
|
||||
@Table(name = "migtest_e_ref")
|
||||
@@ -16,4 +20,9 @@ public class ERef {
|
||||
|
||||
@OneToMany
|
||||
List<EBasic> basics;
|
||||
|
||||
@NotNull
|
||||
@Index(unique = true)
|
||||
@Size(max=127)
|
||||
String name;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package misc.migration.v1_2;
|
||||
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@Entity
|
||||
@Table(name = "migtest_mtm_c")
|
||||
public class MtmChild {
|
||||
|
||||
@Id
|
||||
Integer id;
|
||||
|
||||
String name;
|
||||
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package misc.migration.v1_2;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@Entity
|
||||
@Table(name = "migtest_mtm_m")
|
||||
public class MtmMaster {
|
||||
|
||||
@Id
|
||||
Long id;
|
||||
|
||||
String name;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package misc.migration.v1_2;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@Entity
|
||||
@Table(name = "migtest_oto_child")
|
||||
public class OtoChild {
|
||||
|
||||
@Id
|
||||
Integer id;
|
||||
|
||||
String name;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package misc.migration.v1_2;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@Entity
|
||||
@Table(name = "migtest_oto_master")
|
||||
public class OtoMaster {
|
||||
|
||||
@Id
|
||||
Long id;
|
||||
|
||||
String name;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user