Hibernate SVN: r15782 - in annotations/branches/v3_2_1_GA_CP/src/test/org/hibernate/test/annotations: cascade and 4 other directories.
by hibernate-commits@lists.jboss.org
Author: jcosta(a)redhat.com
Date: 2009-01-14 09:36:52 -0500 (Wed, 14 Jan 2009)
New Revision: 15782
Modified:
annotations/branches/v3_2_1_GA_CP/src/test/org/hibernate/test/annotations/access/BigBed.java
annotations/branches/v3_2_1_GA_CP/src/test/org/hibernate/test/annotations/cascade/Mouth.java
annotations/branches/v3_2_1_GA_CP/src/test/org/hibernate/test/annotations/embedded/Book.java
annotations/branches/v3_2_1_GA_CP/src/test/org/hibernate/test/annotations/embedded/Summary.java
annotations/branches/v3_2_1_GA_CP/src/test/org/hibernate/test/annotations/inheritance/Tomato.java
annotations/branches/v3_2_1_GA_CP/src/test/org/hibernate/test/annotations/inheritance/mixed/Document.java
annotations/branches/v3_2_1_GA_CP/src/test/org/hibernate/test/annotations/query/Chaos.java
Log:
JBPAPP-1073 - Fixed reserved keywords in Oracle for some models
Modified: annotations/branches/v3_2_1_GA_CP/src/test/org/hibernate/test/annotations/access/BigBed.java
===================================================================
--- annotations/branches/v3_2_1_GA_CP/src/test/org/hibernate/test/annotations/access/BigBed.java 2009-01-14 14:15:30 UTC (rev 15781)
+++ annotations/branches/v3_2_1_GA_CP/src/test/org/hibernate/test/annotations/access/BigBed.java 2009-01-14 14:36:52 UTC (rev 15782)
@@ -1,6 +1,7 @@
//$Id$
package org.hibernate.test.annotations.access;
+import javax.persistence.Column;
import javax.persistence.Entity;
/**
@@ -8,5 +9,6 @@
*/
@Entity
public class BigBed extends Bed {
+ @Column(name="xsize")
public int size;
}
Modified: annotations/branches/v3_2_1_GA_CP/src/test/org/hibernate/test/annotations/cascade/Mouth.java
===================================================================
--- annotations/branches/v3_2_1_GA_CP/src/test/org/hibernate/test/annotations/cascade/Mouth.java 2009-01-14 14:15:30 UTC (rev 15781)
+++ annotations/branches/v3_2_1_GA_CP/src/test/org/hibernate/test/annotations/cascade/Mouth.java 2009-01-14 14:36:52 UTC (rev 15782)
@@ -2,7 +2,9 @@
package org.hibernate.test.annotations.cascade;
import java.util.Collection;
+
import javax.persistence.CascadeType;
+import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
@@ -16,6 +18,7 @@
@Id
@GeneratedValue
public Integer id;
+ @Column(name="xsize")
public int size;
@OneToMany(mappedBy = "mouth", cascade = CascadeType.REMOVE)
public Collection<Tooth> teeth;
Modified: annotations/branches/v3_2_1_GA_CP/src/test/org/hibernate/test/annotations/embedded/Book.java
===================================================================
--- annotations/branches/v3_2_1_GA_CP/src/test/org/hibernate/test/annotations/embedded/Book.java 2009-01-14 14:15:30 UTC (rev 15781)
+++ annotations/branches/v3_2_1_GA_CP/src/test/org/hibernate/test/annotations/embedded/Book.java 2009-01-14 14:36:52 UTC (rev 15782)
@@ -36,7 +36,7 @@
}
@AttributeOverrides({
- @AttributeOverride(name = "size", column = @Column(table = "BookSummary")),
+ @AttributeOverride(name = "size", column = @Column(table = "BookSummary", name="xsize")),
@AttributeOverride(name = "text", column = @Column(table = "BookSummary"))
})
public Summary getSummary() {
Modified: annotations/branches/v3_2_1_GA_CP/src/test/org/hibernate/test/annotations/embedded/Summary.java
===================================================================
--- annotations/branches/v3_2_1_GA_CP/src/test/org/hibernate/test/annotations/embedded/Summary.java 2009-01-14 14:15:30 UTC (rev 15781)
+++ annotations/branches/v3_2_1_GA_CP/src/test/org/hibernate/test/annotations/embedded/Summary.java 2009-01-14 14:36:52 UTC (rev 15782)
@@ -1,6 +1,7 @@
//$Id$
package org.hibernate.test.annotations.embedded;
+import javax.persistence.Column;
import javax.persistence.Embeddable;
import org.hibernate.annotations.Parent;
@@ -14,6 +15,7 @@
private String text;
private Book summarizedBook;
+ @Column(name="xsize")
public int getSize() {
return size;
}
Modified: annotations/branches/v3_2_1_GA_CP/src/test/org/hibernate/test/annotations/inheritance/Tomato.java
===================================================================
--- annotations/branches/v3_2_1_GA_CP/src/test/org/hibernate/test/annotations/inheritance/Tomato.java 2009-01-14 14:15:30 UTC (rev 15781)
+++ annotations/branches/v3_2_1_GA_CP/src/test/org/hibernate/test/annotations/inheritance/Tomato.java 2009-01-14 14:36:52 UTC (rev 15782)
@@ -1,6 +1,7 @@
//$Id$
package org.hibernate.test.annotations.inheritance;
+import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
@@ -21,6 +22,7 @@
public class Tomato extends Vegetable {
private int size;
+ @Column(name="xsize")
public int getSize() {
return size;
}
Modified: annotations/branches/v3_2_1_GA_CP/src/test/org/hibernate/test/annotations/inheritance/mixed/Document.java
===================================================================
--- annotations/branches/v3_2_1_GA_CP/src/test/org/hibernate/test/annotations/inheritance/mixed/Document.java 2009-01-14 14:15:30 UTC (rev 15781)
+++ annotations/branches/v3_2_1_GA_CP/src/test/org/hibernate/test/annotations/inheritance/mixed/Document.java 2009-01-14 14:36:52 UTC (rev 15782)
@@ -25,7 +25,7 @@
this.size = size;
}
- @Column(table = "DocumentMixed", nullable = false)
+ @Column(table = "DocumentMixed", nullable = false, name="xsize")
public int getSize() {
return size;
}
Modified: annotations/branches/v3_2_1_GA_CP/src/test/org/hibernate/test/annotations/query/Chaos.java
===================================================================
--- annotations/branches/v3_2_1_GA_CP/src/test/org/hibernate/test/annotations/query/Chaos.java 2009-01-14 14:15:30 UTC (rev 15781)
+++ annotations/branches/v3_2_1_GA_CP/src/test/org/hibernate/test/annotations/query/Chaos.java 2009-01-14 14:36:52 UTC (rev 15782)
@@ -1,36 +1,38 @@
//$Id: $
package org.hibernate.test.annotations.query;
+import java.util.HashSet;
import java.util.Set;
-import java.util.HashSet;
+
+import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
-import javax.persistence.Table;
-import javax.persistence.NamedQuery;
+import javax.persistence.JoinColumn;
import javax.persistence.NamedNativeQuery;
import javax.persistence.OneToMany;
-import javax.persistence.JoinColumn;
+import javax.persistence.Table;
+import org.hibernate.annotations.Loader;
+import org.hibernate.annotations.SQLDelete;
+import org.hibernate.annotations.SQLDeleteAll;
import org.hibernate.annotations.SQLInsert;
import org.hibernate.annotations.SQLUpdate;
-import org.hibernate.annotations.SQLDelete;
-import org.hibernate.annotations.SQLDeleteAll;
-import org.hibernate.annotations.Loader;
/**
* @author Emmanuel Bernard
*/
@Entity
@Table(name="CHAOS")
-@SQLInsert( sql="INSERT INTO CHAOS(name, nickname, size, id) VALUES(upper(?),?,?,?)")
-@SQLUpdate( sql="UPDATE CHAOS SET name = upper(?), nickname = ?, size = ? WHERE id = ?")
+@SQLInsert( sql="INSERT INTO CHAOS(name, nickname, xsize, id) VALUES(upper(?),?,?,?)")
+@SQLUpdate( sql="UPDATE CHAOS SET name = upper(?), nickname = ?, xsize = ? WHERE id = ?")
@SQLDelete( sql="DELETE CHAOS WHERE id = ?")
@SQLDeleteAll( sql="DELETE CHAOS")
@Loader(namedQuery = "chaos")
-@NamedNativeQuery(name="chaos", query="select id, size, name, lower( nickname ) as nickname from CHAOS where id= ?", resultClass = Chaos.class)
+@NamedNativeQuery(name="chaos", query="select id, xsize, name, lower( nickname ) as nickname from CHAOS where id= ?", resultClass = Chaos.class)
public class Chaos {
@Id
private Long id;
+ @Column(name="xsize")
private Long size;
private String name;
private String nickname;
15 years, 5 months
Hibernate SVN: r15781 - core/trunk/annotations/src/test/java/org/hibernate/test/annotations.
by hibernate-commits@lists.jboss.org
Author: jcosta(a)redhat.com
Date: 2009-01-14 09:15:30 -0500 (Wed, 14 Jan 2009)
New Revision: 15781
Modified:
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/EntityTest.java
Log:
ANN-795 - Added DateFormat to compare dates, otherwise, there are problems with Sybase
Modified: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/EntityTest.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/EntityTest.java 2009-01-14 14:10:36 UTC (rev 15780)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/EntityTest.java 2009-01-14 14:15:30 UTC (rev 15781)
@@ -1,6 +1,8 @@
//$Id$
package org.hibernate.test.annotations;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.List;
@@ -17,9 +19,11 @@
* @author Emmanuel Bernard
*/
public class EntityTest extends TestCase {
-
+ private DateFormat df;
+
public EntityTest(String x) {
super( x );
+ df = SimpleDateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG);
}
public void testLoad() throws Exception {
@@ -337,10 +341,10 @@
Flight copyAirFrance = (Flight) q.uniqueResult();
assertNotNull( copyAirFrance );
assertEquals(
- new Date( 05, 06, 21 ),
- copyAirFrance.getDepartureDate()
+ df.format(new Date( 05, 06, 21 )).toString(),
+ df.format(copyAirFrance.getDepartureDate()).toString()
);
- assertEquals( copyAirFrance.getBuyDate().getTime() / 1000 , airFrance.getBuyDate().getTime() / 1000 );
+ assertEquals( df.format(airFrance.getBuyDate()), df.format(copyAirFrance.getBuyDate()));
s.delete( copyAirFrance );
tx.commit();
15 years, 5 months
Hibernate SVN: r15780 - annotations/branches/v3_2_1_GA_CP/src/test/org/hibernate/test/annotations.
by hibernate-commits@lists.jboss.org
Author: jcosta(a)redhat.com
Date: 2009-01-14 09:10:36 -0500 (Wed, 14 Jan 2009)
New Revision: 15780
Modified:
annotations/branches/v3_2_1_GA_CP/src/test/org/hibernate/test/annotations/EntityTest.java
Log:
ANN-795 - Added DateFormat to compare dates, otherwise, there are problems with Sybase
Modified: annotations/branches/v3_2_1_GA_CP/src/test/org/hibernate/test/annotations/EntityTest.java
===================================================================
--- annotations/branches/v3_2_1_GA_CP/src/test/org/hibernate/test/annotations/EntityTest.java 2009-01-14 13:59:49 UTC (rev 15779)
+++ annotations/branches/v3_2_1_GA_CP/src/test/org/hibernate/test/annotations/EntityTest.java 2009-01-14 14:10:36 UTC (rev 15780)
@@ -1,6 +1,8 @@
//$Id$
package org.hibernate.test.annotations;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.List;
@@ -17,9 +19,11 @@
* @author Emmanuel Bernard
*/
public class EntityTest extends TestCase {
-
+ private DateFormat df;
+
public EntityTest(String x) {
super( x );
+ df = SimpleDateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG);
}
public void testLoad() throws Exception {
@@ -324,10 +328,10 @@
Flight copyAirFrance = (Flight) q.uniqueResult();
assertNotNull( airFrance );
assertEquals(
- new Date( 05, 06, 21 ),
- copyAirFrance.getDepartureDate()
+ df.format(new Date( 05, 06, 21 )).toString(),
+ df.format(copyAirFrance.getDepartureDate()).toString()
);
- assertEquals( airFrance.getBuyDate(), copyAirFrance.getBuyDate());
+ assertEquals( df.format(airFrance.getBuyDate()), df.format(copyAirFrance.getBuyDate()));
s.delete( copyAirFrance );
tx.commit();
s.close();
15 years, 5 months
Hibernate SVN: r15779 - annotations/branches/v3_2_1_GA_CP/src/test/org/hibernate/search/test/bridge.
by hibernate-commits@lists.jboss.org
Author: jcosta(a)redhat.com
Date: 2009-01-14 08:59:49 -0500 (Wed, 14 Jan 2009)
New Revision: 15779
Modified:
annotations/branches/v3_2_1_GA_CP/src/test/org/hibernate/search/test/bridge/Cloud.java
Log:
HSEARCH-316 - Model also present in ANN. Fixing it
Modified: annotations/branches/v3_2_1_GA_CP/src/test/org/hibernate/search/test/bridge/Cloud.java
===================================================================
--- annotations/branches/v3_2_1_GA_CP/src/test/org/hibernate/search/test/bridge/Cloud.java 2009-01-14 13:06:17 UTC (rev 15778)
+++ annotations/branches/v3_2_1_GA_CP/src/test/org/hibernate/search/test/bridge/Cloud.java 2009-01-14 13:59:49 UTC (rev 15779)
@@ -2,17 +2,19 @@
package org.hibernate.search.test.bridge;
import java.util.Date;
+
+import javax.persistence.Column;
import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
import javax.persistence.Id;
-import javax.persistence.GeneratedValue;
-import org.hibernate.search.annotations.Keyword;
-import org.hibernate.search.annotations.Indexed;
-import org.hibernate.search.annotations.Text;
+import org.hibernate.annotations.Parameter;
import org.hibernate.search.annotations.DateBridge;
import org.hibernate.search.annotations.FieldBridge;
+import org.hibernate.search.annotations.Indexed;
+import org.hibernate.search.annotations.Keyword;
import org.hibernate.search.annotations.Resolution;
-import org.hibernate.annotations.Parameter;
+import org.hibernate.search.annotations.Text;
/**
* @author Emmanuel Bernard
@@ -89,6 +91,7 @@
}
@Keyword
+ @Column(name="int1x")
public Integer getInt1() {
return int1;
}
@@ -98,6 +101,7 @@
}
@Keyword
+ @Column(name="int2x")
public int getInt2() {
return int2;
}
@@ -152,6 +156,7 @@
}
@Keyword
+ @Column(name="xdate")
public Date getDate() {
return date;
}
15 years, 5 months
Hibernate SVN: r15778 - core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test.
by hibernate-commits@lists.jboss.org
Author: jcosta(a)redhat.com
Date: 2009-01-14 08:06:17 -0500 (Wed, 14 Jan 2009)
New Revision: 15778
Modified:
core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/QueryTest.java
Log:
EJB-404 JBPAPP-1079 - Fixed the test case for PostgreSQL and DB2
Modified: core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/QueryTest.java
===================================================================
--- core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/QueryTest.java 2009-01-14 13:04:15 UTC (rev 15777)
+++ core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/QueryTest.java 2009-01-14 13:06:17 UTC (rev 15778)
@@ -305,7 +305,7 @@
em.flush();
em.clear();
Query q = em.createQuery(
- "select i from Item i where i.descr = :descr or (i.descr is null and :descr is null)"
+ "select i from Item i where i.descr = :descr or (i.descr is null and cast(:descr as string) is null)"
);
//Query q = em.createQuery( "select i from Item i where (i.descr is null and :descr is null) or (i.descr = :descr");
q.setParameter( "descr", "dd" );
15 years, 5 months
Hibernate SVN: r15777 - entitymanager/branches/v3_3_2_GA_CP/src/test/org/hibernate/ejb/test.
by hibernate-commits@lists.jboss.org
Author: jcosta(a)redhat.com
Date: 2009-01-14 08:04:15 -0500 (Wed, 14 Jan 2009)
New Revision: 15777
Modified:
entitymanager/branches/v3_3_2_GA_CP/src/test/org/hibernate/ejb/test/QueryTest.java
Log:
EJB-404 JBPAPP-1079 - Fixed the test case for PostgreSQL and DB2
Modified: entitymanager/branches/v3_3_2_GA_CP/src/test/org/hibernate/ejb/test/QueryTest.java
===================================================================
--- entitymanager/branches/v3_3_2_GA_CP/src/test/org/hibernate/ejb/test/QueryTest.java 2009-01-14 13:01:25 UTC (rev 15776)
+++ entitymanager/branches/v3_3_2_GA_CP/src/test/org/hibernate/ejb/test/QueryTest.java 2009-01-14 13:04:15 UTC (rev 15777)
@@ -305,7 +305,7 @@
em.flush();
em.clear();
Query q = em.createQuery(
- "select i from Item i where (i.descr is null and :descr is null) or i.descr = :descr"
+ "select i from Item i where i.descr = :descr or (i.descr is null and cast(:descr as string) is null)"
);
//Query q = em.createQuery( "select i from Item i where (i.descr is null and :descr is null) or (i.descr = :descr");
q.setParameter( "descr", "dd" );
15 years, 5 months
Hibernate SVN: r15776 - entitymanager/branches/v3_2_1_GA_CP/src/test/org/hibernate/ejb/test.
by hibernate-commits@lists.jboss.org
Author: jcosta(a)redhat.com
Date: 2009-01-14 08:01:25 -0500 (Wed, 14 Jan 2009)
New Revision: 15776
Modified:
entitymanager/branches/v3_2_1_GA_CP/src/test/org/hibernate/ejb/test/QueryTest.java
Log:
EJB-404 JBPAPP-1079 - Fixed the test case for PostgreSQL and DB2
Modified: entitymanager/branches/v3_2_1_GA_CP/src/test/org/hibernate/ejb/test/QueryTest.java
===================================================================
--- entitymanager/branches/v3_2_1_GA_CP/src/test/org/hibernate/ejb/test/QueryTest.java 2009-01-14 12:39:27 UTC (rev 15775)
+++ entitymanager/branches/v3_2_1_GA_CP/src/test/org/hibernate/ejb/test/QueryTest.java 2009-01-14 13:01:25 UTC (rev 15776)
@@ -302,7 +302,7 @@
em.flush();
em.clear();
Query q = em.createQuery(
- "select i from Item i where (i.descr is null and :descr is null) or i.descr = :descr"
+ "select i from Item i where i.descr = :descr or (i.descr is null and cast(:descr as string) is null)"
);
//Query q = em.createQuery( "select i from Item i where (i.descr is null and :descr is null) or (i.descr = :descr");
q.setParameter( "descr", "dd" );
15 years, 5 months
Hibernate SVN: r15775 - in entitymanager/branches/v3_3_2_GA_CP/src/test/org/hibernate/ejb/test: inheritance and 2 other directories.
by hibernate-commits@lists.jboss.org
Author: jcosta(a)redhat.com
Date: 2009-01-14 07:39:27 -0500 (Wed, 14 Jan 2009)
New Revision: 15775
Modified:
entitymanager/branches/v3_3_2_GA_CP/src/test/org/hibernate/ejb/test/emops/Race.java
entitymanager/branches/v3_3_2_GA_CP/src/test/org/hibernate/ejb/test/inheritance/Strawberry.java
entitymanager/branches/v3_3_2_GA_CP/src/test/org/hibernate/ejb/test/lock/Lock.java
entitymanager/branches/v3_3_2_GA_CP/src/test/org/hibernate/ejb/test/ops/Workload.java
Log:
EJB-405 JBPAPP-1077 - Added explicit names for some columns and entities which uses reserved keywords in its names
Modified: entitymanager/branches/v3_3_2_GA_CP/src/test/org/hibernate/ejb/test/emops/Race.java
===================================================================
--- entitymanager/branches/v3_3_2_GA_CP/src/test/org/hibernate/ejb/test/emops/Race.java 2009-01-14 12:39:07 UTC (rev 15774)
+++ entitymanager/branches/v3_3_2_GA_CP/src/test/org/hibernate/ejb/test/emops/Race.java 2009-01-14 12:39:27 UTC (rev 15775)
@@ -18,7 +18,7 @@
@Entity
public class Race {
@Id @GeneratedValue public Integer id;
- @IndexColumn( name="index" ) @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
+ @IndexColumn( name="index_" ) @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
@org.hibernate.annotations.Cascade( { org.hibernate.annotations.CascadeType.ALL, org.hibernate.annotations.CascadeType.DELETE_ORPHAN })
public List<Competitor> competitors = new ArrayList<Competitor>();
public String name;
Modified: entitymanager/branches/v3_3_2_GA_CP/src/test/org/hibernate/ejb/test/inheritance/Strawberry.java
===================================================================
--- entitymanager/branches/v3_3_2_GA_CP/src/test/org/hibernate/ejb/test/inheritance/Strawberry.java 2009-01-14 12:39:07 UTC (rev 15774)
+++ entitymanager/branches/v3_3_2_GA_CP/src/test/org/hibernate/ejb/test/inheritance/Strawberry.java 2009-01-14 12:39:27 UTC (rev 15775)
@@ -1,6 +1,7 @@
//$Id: $
package org.hibernate.ejb.test.inheritance;
+import javax.persistence.Column;
import javax.persistence.Entity;
/**
@@ -10,6 +11,7 @@
public class Strawberry extends Fruit {
private Long size;
+ @Column(name="size_")
public Long getSize() {
return size;
}
Modified: entitymanager/branches/v3_3_2_GA_CP/src/test/org/hibernate/ejb/test/lock/Lock.java
===================================================================
--- entitymanager/branches/v3_3_2_GA_CP/src/test/org/hibernate/ejb/test/lock/Lock.java 2009-01-14 12:39:07 UTC (rev 15774)
+++ entitymanager/branches/v3_3_2_GA_CP/src/test/org/hibernate/ejb/test/lock/Lock.java 2009-01-14 12:39:27 UTC (rev 15775)
@@ -9,7 +9,7 @@
/**
* @author Emmanuel Bernard
*/
-@Entity
+@Entity(name="Lock_")
public class Lock {
private Integer id;
private Integer version;
Modified: entitymanager/branches/v3_3_2_GA_CP/src/test/org/hibernate/ejb/test/ops/Workload.java
===================================================================
--- entitymanager/branches/v3_3_2_GA_CP/src/test/org/hibernate/ejb/test/ops/Workload.java 2009-01-14 12:39:07 UTC (rev 15774)
+++ entitymanager/branches/v3_3_2_GA_CP/src/test/org/hibernate/ejb/test/ops/Workload.java 2009-01-14 12:39:27 UTC (rev 15775)
@@ -1,6 +1,7 @@
//$Id$
package org.hibernate.ejb.test.ops;
+import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
@@ -14,5 +15,6 @@
@GeneratedValue
public Integer id;
public String name;
+ @Column(name="load_")
public Integer load;
}
15 years, 5 months