mirror of https://github.com/apache/openjpa.git
OPENJPA-869 Fixup order column test variations failing on Oracle.
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@813556 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0d3179cef9
commit
b5fabd88dd
|
@ -43,15 +43,15 @@ public class ColDefTestEntity {
|
|||
private int id;
|
||||
|
||||
@OneToMany(cascade=CascadeType.PERSIST)
|
||||
@OrderColumn(name="one2McoldefOrder", columnDefinition="BIGINT")
|
||||
@OrderColumn(name="one2McoldefOrder", columnDefinition="INTEGER")
|
||||
private List<ColDefTestElement> one2Mcoldef;
|
||||
|
||||
@ElementCollection
|
||||
@OrderColumn(name="colcoldefOrder", columnDefinition="BIGINT")
|
||||
@OrderColumn(name="colcoldefOrder", columnDefinition="INTEGER")
|
||||
private Set<ColDefTestElement> collcoldef;
|
||||
|
||||
@ManyToMany(cascade=CascadeType.PERSIST)
|
||||
@OrderColumn(name="m2McoldefOrder", columnDefinition="BIGINT")
|
||||
@OrderColumn(name="m2McoldefOrder", columnDefinition="INTEGER")
|
||||
private List<ColDefTestElement> m2mcoldef;
|
||||
|
||||
public void setOne2Mcoldef(List<ColDefTestElement> one2Mcoldef) {
|
||||
|
|
|
@ -23,7 +23,7 @@ import javax.persistence.Embeddable;
|
|||
@Embeddable
|
||||
public class Inning {
|
||||
|
||||
private int number;
|
||||
private int inningNumber;
|
||||
|
||||
private int hitsHome;
|
||||
|
||||
|
@ -33,17 +33,17 @@ public class Inning {
|
|||
}
|
||||
|
||||
public Inning(int num, int hh, int ha) {
|
||||
number = num;
|
||||
inningNumber = num;
|
||||
hitsHome = hh;
|
||||
hitsAway = ha;
|
||||
}
|
||||
|
||||
public void setNumber(int number) {
|
||||
this.number = number;
|
||||
public void setInningNumber(int number) {
|
||||
this.inningNumber = number;
|
||||
}
|
||||
|
||||
public int getNumber() {
|
||||
return number;
|
||||
public int getInningNumber() {
|
||||
return inningNumber;
|
||||
}
|
||||
|
||||
public void setHitsHome(int hitsHome) {
|
||||
|
@ -65,7 +65,7 @@ public class Inning {
|
|||
public boolean equals(Object obj) {
|
||||
if (obj instanceof Inning) {
|
||||
Inning in = (Inning)obj;
|
||||
return getNumber() == in.getNumber() &&
|
||||
return getInningNumber() == in.getInningNumber() &&
|
||||
getHitsHome() == in.getHitsHome() &&
|
||||
getHitsAway() == in.getHitsAway();
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ import javax.persistence.OrderColumn;
|
|||
@Entity
|
||||
public class Player extends Person {
|
||||
|
||||
private int number;
|
||||
private int playerNumber;
|
||||
|
||||
@ManyToMany(mappedBy="playersTrained")
|
||||
private List<Trainer> trainers;
|
||||
|
@ -41,15 +41,15 @@ public class Player extends Person {
|
|||
|
||||
public Player(String name, int number) {
|
||||
setName(name);
|
||||
this.number = number;
|
||||
this.playerNumber = number;
|
||||
}
|
||||
|
||||
public void setNumber(int number) {
|
||||
this.number = number;
|
||||
public void setPlayerNumber(int number) {
|
||||
this.playerNumber = number;
|
||||
}
|
||||
|
||||
public int getNumber() {
|
||||
return number;
|
||||
public int getPlayerNumber() {
|
||||
return playerNumber;
|
||||
}
|
||||
|
||||
public void setTrainers(List<Trainer> trainers) {
|
||||
|
@ -64,7 +64,7 @@ public class Player extends Person {
|
|||
if (obj instanceof Player) {
|
||||
Player player = (Player)obj;
|
||||
return super.equals(obj) &&
|
||||
player.getNumber() == number;
|
||||
player.getPlayerNumber() == playerNumber;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -89,15 +89,9 @@ public class TestOrderColumnXML extends AbstractCachedEMFTestCase {
|
|||
}
|
||||
|
||||
/*
|
||||
* Validates the use of the columnDefinition attribute on OrderColumn. This
|
||||
* test will be skipped unless the database in use is Derby since the
|
||||
* annotation column definition attribute value is hard coded and all
|
||||
* databases may not support the supplied column definition.
|
||||
* Validates the use of the columnDefinition attribute on OrderColumn.
|
||||
*/
|
||||
public void testOrderColumnColumnDefinition() {
|
||||
if (!isTargetPlatform("derby")) {
|
||||
return;
|
||||
}
|
||||
|
||||
OpenJPAEntityManagerFactorySPI emf1 =
|
||||
(OpenJPAEntityManagerFactorySPI)OpenJPAPersistence.
|
||||
|
@ -110,13 +104,13 @@ public class TestOrderColumnXML extends AbstractCachedEMFTestCase {
|
|||
//
|
||||
// Create a collection using a custom column definition
|
||||
validateOrderColumnDef(emf1, ColDefTestEntity.class,
|
||||
"one2Mcoldef", "BIGINT");
|
||||
"one2Mcoldef", "INTEGER");
|
||||
|
||||
validateOrderColumnDef(emf1, ColDefTestEntity.class,
|
||||
"collcoldef", "BIGINT");
|
||||
"collcoldef", "INTEGER");
|
||||
|
||||
validateOrderColumnDef(emf1, ColDefTestEntity.class,
|
||||
"m2mcoldef", "BIGINT");
|
||||
"m2mcoldef", "INTEGER");
|
||||
|
||||
// Add and query some values
|
||||
ColDefTestEntity cdent = new ColDefTestEntity();
|
||||
|
|
Loading…
Reference in New Issue