[hibernate-commits] Hibernate SVN: r14388 - in annotations/trunk/src/test/org/hibernate/test/annotations/collectionelement: deepcollectionelements and 1 other directory.

hibernate-commits at lists.jboss.org hibernate-commits at lists.jboss.org
Tue Mar 4 13:07:29 EST 2008


Author: epbernard
Date: 2008-03-04 13:07:28 -0500 (Tue, 04 Mar 2008)
New Revision: 14388

Added:
   annotations/trunk/src/test/org/hibernate/test/annotations/collectionelement/deepcollectionelements/
   annotations/trunk/src/test/org/hibernate/test/annotations/collectionelement/deepcollectionelements/A.java
   annotations/trunk/src/test/org/hibernate/test/annotations/collectionelement/deepcollectionelements/B.java
   annotations/trunk/src/test/org/hibernate/test/annotations/collectionelement/deepcollectionelements/C.java
   annotations/trunk/src/test/org/hibernate/test/annotations/collectionelement/deepcollectionelements/DeepCollectionElementTest.java
Log:
ANN-591 tests

Added: annotations/trunk/src/test/org/hibernate/test/annotations/collectionelement/deepcollectionelements/A.java
===================================================================
--- annotations/trunk/src/test/org/hibernate/test/annotations/collectionelement/deepcollectionelements/A.java	                        (rev 0)
+++ annotations/trunk/src/test/org/hibernate/test/annotations/collectionelement/deepcollectionelements/A.java	2008-03-04 18:07:28 UTC (rev 14388)
@@ -0,0 +1,45 @@
+//$
+package org.hibernate.test.annotations.collectionelement.deepcollectionelements;
+
+/**
+ * @author Emmanuel Bernard
+ */
+
+import java.util.List;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.SequenceGenerator;
+import javax.persistence.Table;
+
+import org.hibernate.annotations.CollectionOfElements;
+import org.hibernate.annotations.IndexColumn;
+
+ at Entity
+ at Table( name = "A" )
+public class A {
+	@Id
+	@GeneratedValue( strategy = GenerationType.SEQUENCE, generator = "aSequence" )
+	@SequenceGenerator( name = "aSequence", sequenceName = "seq_A" )
+	private int id;
+	@CollectionOfElements
+	@IndexColumn( name = "ndx" )
+	private List<B> listOfB;
+
+	public int getId() {
+		return id;
+	}
+
+	public void setId(int id) {
+		this.id = id;
+	}
+
+	public List<B> getListOfB() {
+		return listOfB;
+	}
+
+	public void setListOfB(List<B> listOfB) {
+		this.listOfB = listOfB;
+	}
+}

Added: annotations/trunk/src/test/org/hibernate/test/annotations/collectionelement/deepcollectionelements/B.java
===================================================================
--- annotations/trunk/src/test/org/hibernate/test/annotations/collectionelement/deepcollectionelements/B.java	                        (rev 0)
+++ annotations/trunk/src/test/org/hibernate/test/annotations/collectionelement/deepcollectionelements/B.java	2008-03-04 18:07:28 UTC (rev 14388)
@@ -0,0 +1,36 @@
+//$
+package org.hibernate.test.annotations.collectionelement.deepcollectionelements;
+
+import java.util.List;
+import javax.persistence.Embeddable;
+import javax.persistence.Transient;
+import javax.persistence.OneToMany;
+
+import org.hibernate.annotations.CollectionOfElements;
+import org.hibernate.annotations.IndexColumn;
+
+ at Embeddable
+public class B {
+	private String name;
+
+	//@CollectionOfElements
+	@OneToMany
+	@IndexColumn( name = "ndx" )
+	private List<C> listOfC;
+
+	public List<C> getListOfC() {
+		return listOfC;
+	}
+
+	public void setListOfC(List<C> listOfC) {
+		this.listOfC = listOfC;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+}

Added: annotations/trunk/src/test/org/hibernate/test/annotations/collectionelement/deepcollectionelements/C.java
===================================================================
--- annotations/trunk/src/test/org/hibernate/test/annotations/collectionelement/deepcollectionelements/C.java	                        (rev 0)
+++ annotations/trunk/src/test/org/hibernate/test/annotations/collectionelement/deepcollectionelements/C.java	2008-03-04 18:07:28 UTC (rev 14388)
@@ -0,0 +1,27 @@
+//$
+package org.hibernate.test.annotations.collectionelement.deepcollectionelements;
+
+import javax.persistence.Column;
+import javax.persistence.Embeddable;
+import javax.persistence.Id;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Entity;
+
+
+ at Entity
+public class C {
+	@Id
+	@GeneratedValue
+	private int id;
+
+	@Column( length = 500 )
+	private String comment;
+
+	public String getComment() {
+		return comment;
+	}
+
+	public void setComment(String comment) {
+		this.comment = comment;
+	}
+}

Added: annotations/trunk/src/test/org/hibernate/test/annotations/collectionelement/deepcollectionelements/DeepCollectionElementTest.java
===================================================================
--- annotations/trunk/src/test/org/hibernate/test/annotations/collectionelement/deepcollectionelements/DeepCollectionElementTest.java	                        (rev 0)
+++ annotations/trunk/src/test/org/hibernate/test/annotations/collectionelement/deepcollectionelements/DeepCollectionElementTest.java	2008-03-04 18:07:28 UTC (rev 14388)
@@ -0,0 +1,25 @@
+//$
+package org.hibernate.test.annotations.collectionelement.deepcollectionelements;
+
+import org.hibernate.test.annotations.TestCase;
+
+/**
+ * @author Emmanuel Bernard
+ */
+
+//TEST not used: wait for ANN-591 and HHH-3157 
+public class DeepCollectionElementTest extends TestCase {
+
+	public void testInitialization() throws Exception {
+		//test only the SF creation
+
+	}
+
+	protected Class[] getMappings() {
+		return new Class[] {
+				//A.class,
+				//B.class,
+				//C.class
+		};
+	}
+}




More information about the hibernate-commits mailing list