Hibernate SVN: r21163 - in annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test: jpa/ql and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: brmeyer
Date: 2014-04-14 13:49:58 -0400 (Mon, 14 Apr 2014)
New Revision: 21163
Modified:
annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/collectionalias/CollectionAliasTest.java
annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/jpa/ql/DestinationEntity.java
annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/jpa/ql/NamedNativeQueryTest.java
Log:
JBPAPP-11125 JBPAPP-11123 correct NamedNativeQueryTest, CollectionAliasTest, & ReorderedMappingsCollectionAliasTest
Modified: annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/collectionalias/CollectionAliasTest.java
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/collectionalias/CollectionAliasTest.java 2014-04-14 14:37:42 UTC (rev 21162)
+++ annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/collectionalias/CollectionAliasTest.java 2014-04-14 17:49:58 UTC (rev 21163)
@@ -47,7 +47,7 @@
s.close();
s = openSession();
- aTable = (ATable) s.createQuery( "select distinct tablea from ATable tablea LEFT JOIN FETCH tablea.tablebs " ).uniqueResult();
+ aTable = (ATable) s.createQuery( "select distinct tablea from ATable tablea LEFT JOIN FETCH tablea.tablebs " ).uniqueResult();
assertEquals( new Integer( 1 ), aTable.getFirstId() );
assertEquals( 1, aTable.getTablebs().size() );
tableB = aTable.getTablebs().get( 0 );
@@ -56,6 +56,12 @@
assertEquals( "a", tableB.getId().getSecondId() );
assertEquals( "b", tableB.getId().getThirdId() );
s.close();
+
+ s = openSession();
+ s.getTransaction().begin();
+ s.createQuery("DELETE FROM java.lang.Object");
+ s.getTransaction().commit();
+ s.close();
}
@Override
Modified: annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/jpa/ql/DestinationEntity.java
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/jpa/ql/DestinationEntity.java 2014-04-14 14:37:42 UTC (rev 21162)
+++ annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/jpa/ql/DestinationEntity.java 2014-04-14 17:49:58 UTC (rev 21163)
@@ -30,6 +30,8 @@
import javax.persistence.NamedNativeQuery;
import javax.persistence.Table;
+import org.hibernate.annotations.GenericGenerator;
+
/**
* @author Janario Oliveira
*/
@@ -47,7 +49,8 @@
public class DestinationEntity {
@Id
- @GeneratedValue
+ @GeneratedValue(generator = "seqStyle")
+ @GenericGenerator(name = "seqStyle", strategy = "org.hibernate.id.enhanced.SequenceStyleGenerator")
Integer id;
@ManyToOne(optional = false)
@JoinColumn(name = "from_id")
Modified: annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/jpa/ql/NamedNativeQueryTest.java
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/jpa/ql/NamedNativeQueryTest.java 2014-04-14 14:37:42 UTC (rev 21162)
+++ annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/jpa/ql/NamedNativeQueryTest.java 2014-04-14 17:49:58 UTC (rev 21163)
@@ -304,6 +304,17 @@
List<DestinationEntity> list = findDestinationByIds( ids );
assertTrue( list.isEmpty() );
}
+
+ @Override
+ protected void tearDown() throws Exception {
+ Session s = openSession();
+ s.getTransaction().begin();
+ s.createQuery("DELETE FROM java.lang.Object");
+ s.getTransaction().commit();
+ s.close();
+
+ super.tearDown();
+ }
@Override
protected Class[] getAnnotatedClasses() {