From dd8c7c0cd791324e566dd2e805623cee82144b71 Mon Sep 17 00:00:00 2001 From: brmeyer Date: Mon, 29 Oct 2012 13:46:47 -0400 Subject: [PATCH] HHH-7732 QueryTest#testMemberOfSyntax failing on Oracle --- .../EntityWithAnElementCollection.java | 17 ++++++++++++++--- .../collectionelement/QueryTest.java | 1 - 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/collectionelement/EntityWithAnElementCollection.java b/hibernate-core/src/test/java/org/hibernate/test/annotations/collectionelement/EntityWithAnElementCollection.java index f8a1996352..1c5609cd3c 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/collectionelement/EntityWithAnElementCollection.java +++ b/hibernate-core/src/test/java/org/hibernate/test/annotations/collectionelement/EntityWithAnElementCollection.java @@ -23,16 +23,23 @@ */ package org.hibernate.test.annotations.collectionelement; -import javax.persistence.ElementCollection; -import javax.persistence.Entity; -import javax.persistence.Id; import java.util.HashSet; import java.util.Set; +import javax.persistence.ElementCollection; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.JoinTable; +import javax.persistence.Table; + /** * @author Steve Ebersole + * @author Brett Meyer */ @Entity +// HHH-7732 -- "EntityWithAnElementCollection" is too long for Oracle. +@Table( name = "EWAEC" ) public class EntityWithAnElementCollection { private Long id; private Set someStrings = new HashSet(); @@ -47,6 +54,10 @@ public class EntityWithAnElementCollection { } @ElementCollection + // HHH-7732 -- "EntityWithAnElementCollection_someStrings" is too long for Oracle. + @JoinTable( + name = "SomeStrings", + joinColumns = @JoinColumn( name = "EWAEC_ID") ) public Set getSomeStrings() { return someStrings; } diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/collectionelement/QueryTest.java b/hibernate-core/src/test/java/org/hibernate/test/annotations/collectionelement/QueryTest.java index 329711c086..c56fbcaf63 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/collectionelement/QueryTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/annotations/collectionelement/QueryTest.java @@ -44,7 +44,6 @@ public class QueryTest extends BaseCoreFunctionalTestCase { public void testMemberOfSyntax() { // performs syntax checking of the MEMBER OF predicate against a basic collection Session s = openSession(); -// s.createQuery( "from EntityWithAnElementCollection e where 'abc' in elements( e.someStrings )" ).list(); s.createQuery( "from EntityWithAnElementCollection e where 'abc' member of e.someStrings" ).list(); s.close(); }