[hibernate-commits] Hibernate SVN: r16481 - in branches/Branch_3_2/HibernateExt/annotations/src/test/org/hibernate/test/annotations: inheritance/joined and 1 other directories.

hibernate-commits at lists.jboss.org hibernate-commits at lists.jboss.org
Wed Apr 29 13:58:48 EDT 2009


Author: jcosta at redhat.com
Date: 2009-04-29 13:58:48 -0400 (Wed, 29 Apr 2009)
New Revision: 16481

Added:
   branches/Branch_3_2/HibernateExt/annotations/src/test/org/hibernate/test/annotations/generics/Classes.java
Modified:
   branches/Branch_3_2/HibernateExt/annotations/src/test/org/hibernate/test/annotations/generics/EmbeddedGenericsTest.java
   branches/Branch_3_2/HibernateExt/annotations/src/test/org/hibernate/test/annotations/inheritance/joined/Alarm.java
   branches/Branch_3_2/HibernateExt/annotations/src/test/org/hibernate/test/annotations/manytoone/ForestType.java
Log:
JBPAPP-1124 ANN-779 : Oracle/DB2 - Identifier is too long

Added: branches/Branch_3_2/HibernateExt/annotations/src/test/org/hibernate/test/annotations/generics/Classes.java
===================================================================
--- branches/Branch_3_2/HibernateExt/annotations/src/test/org/hibernate/test/annotations/generics/Classes.java	                        (rev 0)
+++ branches/Branch_3_2/HibernateExt/annotations/src/test/org/hibernate/test/annotations/generics/Classes.java	2009-04-29 17:58:48 UTC (rev 16481)
@@ -0,0 +1,47 @@
+package org.hibernate.test.annotations.generics;
+
+/**
+ * A test case for ANN-494.
+ *
+ * @author Edward Costello
+ * @author Paolo Perrotta
+ */
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.persistence.Embeddable;
+import javax.persistence.Embedded;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+
+import org.hibernate.annotations.CollectionOfElements;
+
+public class Classes {
+
+	@Embeddable
+	public static class Edition<T> {
+		T name;
+	}
+	
+	@Entity
+	public static class Book {
+		@Id
+		@GeneratedValue(strategy=GenerationType.AUTO)
+		Long id;
+		
+		@Embedded
+		Edition<String> edition;
+	}
+	
+	@Entity
+	public static class PopularBook {
+		@Id
+		@GeneratedValue(strategy=GenerationType.AUTO)
+		Long id;
+		
+		@CollectionOfElements
+		Set<Edition<String>> editions = new HashSet<Edition<String>>();
+	}
+}

Modified: branches/Branch_3_2/HibernateExt/annotations/src/test/org/hibernate/test/annotations/generics/EmbeddedGenericsTest.java
===================================================================
--- branches/Branch_3_2/HibernateExt/annotations/src/test/org/hibernate/test/annotations/generics/EmbeddedGenericsTest.java	2009-04-29 15:31:19 UTC (rev 16480)
+++ branches/Branch_3_2/HibernateExt/annotations/src/test/org/hibernate/test/annotations/generics/EmbeddedGenericsTest.java	2009-04-29 17:58:48 UTC (rev 16481)
@@ -24,13 +24,13 @@
 public class EmbeddedGenericsTest extends TestCase {
 
 	Session session;
-	Edition<String> edition;
+	Classes.Edition<String> edition;
 
 	public void setUp() throws Exception {
 		super.setUp();
 		session = getSessions().openSession();
 		session.getTransaction().begin();
-		edition = new Edition<String>();
+		edition = new Classes.Edition<String>();
 		edition.name = "Second";
 	}
 
@@ -40,31 +40,31 @@
 	}
 
 	public void testWorksWithGenericEmbedded() {
-		Book b = new Book();
+		Classes.Book b = new Classes.Book();
 		b.edition = edition;
 		persist( b );
 		
-		Book retrieved = (Book)find( Book.class, b.id );
+		Classes.Book retrieved = (Classes.Book)find( Classes.Book.class, b.id );
 		assertEquals( "Second", retrieved.edition.name );
 		
-		clean( Book.class, b.id );
+		clean( Classes.Book.class, b.id );
 	}
 
 	public void testWorksWithGenericCollectionOfElements() {
-		PopularBook b = new PopularBook();
+		Classes.PopularBook b = new Classes.PopularBook();
 		b.editions.add( edition );
 		persist( b );
 
-		PopularBook retrieved = (PopularBook)find( PopularBook.class, b.id );
+		Classes.PopularBook retrieved = (Classes.PopularBook)find( Classes.PopularBook.class, b.id );
 		assertEquals( "Second", retrieved.editions.iterator().next().name );
 
-		clean( PopularBook.class, b.id );
+		clean( Classes.PopularBook.class, b.id );
 	}
 
 	protected Class[] getMappings() {
 		return new Class[]{
-				Book.class,
-				PopularBook.class
+				Classes.Book.class,
+				Classes.PopularBook.class
 		};
 	}
 
@@ -84,28 +84,4 @@
 		tx.commit();
 	}
 
-	@Embeddable
-	public static class Edition<T> {
-		T name;
-	}
-	
-	@Entity
-	public static class Book {
-		@Id
-		@GeneratedValue(strategy=GenerationType.AUTO)
-		Long id;
-		
-		@Embedded
-		Edition<String> edition;
-	}
-	
-	@Entity
-	public static class PopularBook {
-		@Id
-		@GeneratedValue(strategy=GenerationType.AUTO)
-		Long id;
-		
-		@CollectionOfElements
-		Set<Edition<String>> editions = new HashSet<Edition<String>>();
-	}
 }

Modified: branches/Branch_3_2/HibernateExt/annotations/src/test/org/hibernate/test/annotations/inheritance/joined/Alarm.java
===================================================================
--- branches/Branch_3_2/HibernateExt/annotations/src/test/org/hibernate/test/annotations/inheritance/joined/Alarm.java	2009-04-29 15:31:19 UTC (rev 16480)
+++ branches/Branch_3_2/HibernateExt/annotations/src/test/org/hibernate/test/annotations/inheritance/joined/Alarm.java	2009-04-29 17:58:48 UTC (rev 16481)
@@ -14,7 +14,7 @@
 	protected EventInformation eventInfo;
 
 	@OneToOne
-	@JoinColumns({@JoinColumn(name = "EVENTINFORMATIONT_NOTIFICATIONID",
+	@JoinColumns({@JoinColumn(name = "EVENTINFO_NOTIFICATIONID",
 			referencedColumnName = "NOTIFICATIONID")})
 	public EventInformation getEventInfo() {
 		return eventInfo;

Modified: branches/Branch_3_2/HibernateExt/annotations/src/test/org/hibernate/test/annotations/manytoone/ForestType.java
===================================================================
--- branches/Branch_3_2/HibernateExt/annotations/src/test/org/hibernate/test/annotations/manytoone/ForestType.java	2009-04-29 15:31:19 UTC (rev 16480)
+++ branches/Branch_3_2/HibernateExt/annotations/src/test/org/hibernate/test/annotations/manytoone/ForestType.java	2009-04-29 17:58:48 UTC (rev 16481)
@@ -23,7 +23,7 @@
 	private BiggestForest biggestRepresentative;
 
 	@OneToOne
-	@JoinTable(name="BiggestRepresentativePerForestType",
+	@JoinTable(name="BiggestRepPerForestType",
 		joinColumns = @JoinColumn(name="forest_type"),
 		inverseJoinColumns = @JoinColumn(name="forest")
 	)




More information about the hibernate-commits mailing list