Author: gbadner
Date: 2010-06-23 14:08:55 -0400 (Wed, 23 Jun 2010)
New Revision: 19802
Modified:
core/branches/Branch_3_5/testsuite/src/test/java/org/hibernate/test/compositeelement/CompositeElementTest.java
Log:
HHH-5305 : Added 'FailureExpected' tests for selecting elements of a collection
mapped as composite-element
Modified:
core/branches/Branch_3_5/testsuite/src/test/java/org/hibernate/test/compositeelement/CompositeElementTest.java
===================================================================
---
core/branches/Branch_3_5/testsuite/src/test/java/org/hibernate/test/compositeelement/CompositeElementTest.java 2010-06-23
17:34:22 UTC (rev 19801)
+++
core/branches/Branch_3_5/testsuite/src/test/java/org/hibernate/test/compositeelement/CompositeElementTest.java 2010-06-23
18:08:55 UTC (rev 19802)
@@ -87,6 +87,70 @@
s.close();
}
+ public void testHandSQLSetOfCompositeElementsByAliasFailureExpected() {
+ Session s = openSession();
+ Transaction t = s.beginTransaction();
+ Child c = new Child( "Child One" );
+ Parent p = new Parent( "Parent" );
+ p.getChildren().add( c );
+ c.setParent( p );
+ s.save( p );
+ s.flush();
+
+ p.getChildren().remove( c );
+ c.setParent( null );
+ s.flush();
+
+ p.getChildren().add( c );
+ c.setParent( p );
+ t.commit();
+ s.close();
+
+ s = openSession();
+ t = s.beginTransaction();
+ s.createQuery("select c from Parent p left outer join p.children
c").uniqueResult();
+ t.commit();
+ s.close();
+
+ s = openSession();
+ t = s.beginTransaction();
+ s.delete( p );
+ t.commit();
+ s.close();
+ }
+
+ public void testHandSQLSetOfCompositeElementsByPathFailureExpected() {
+ Session s = openSession();
+ Transaction t = s.beginTransaction();
+ Child c = new Child( "Child One" );
+ Parent p = new Parent( "Parent" );
+ p.getChildren().add( c );
+ c.setParent( p );
+ s.save( p );
+ s.flush();
+
+ p.getChildren().remove( c );
+ c.setParent( null );
+ s.flush();
+
+ p.getChildren().add( c );
+ c.setParent( p );
+ t.commit();
+ s.close();
+
+ s = openSession();
+ t = s.beginTransaction();
+ s.createQuery("select p.children from Parent p left outer join
p.children").uniqueResult(); //we really need to be able to do this!
+ t.commit();
+ s.close();
+
+ s = openSession();
+ t = s.beginTransaction();
+ s.delete( p );
+ t.commit();
+ s.close();
+ }
+
public void testCustomColumnReadAndWrite() {
final double HEIGHT_INCHES = 49;
final double HEIGHT_CENTIMETERS = HEIGHT_INCHES * 2.54d;
Show replies by date