Author: hardy.ferentschik
Date: 2008-06-29 09:47:11 -0400 (Sun, 29 Jun 2008)
New Revision: 14824
Added:
entitymanager/trunk/src/test/org/hibernate/ejb/test/Kitten.java
Modified:
entitymanager/trunk/src/test-resources/cfgxmlpar/org/hibernate/ejb/test/pack/cfgxmlpar/hibernate.cfg.xml
entitymanager/trunk/src/test-resources/explicitpar/META-INF/persistence.xml
entitymanager/trunk/src/test/org/hibernate/ejb/test/Cat.java
entitymanager/trunk/src/test/org/hibernate/ejb/test/ejb3configuration/EntityManagerSerializationTest.java
entitymanager/trunk/src/test/org/hibernate/ejb/test/ejb3configuration/ProgrammaticConfTest.java
entitymanager/trunk/src/test/org/hibernate/ejb/test/ejb3configuration/hibernate.cfg.xml
entitymanager/trunk/src/test/org/hibernate/ejb/test/hibernate.cfg.xml
Log:
EJB-288
* Updated entities and configuration files due to new test entity Kitten
Modified: entitymanager/trunk/src/test/org/hibernate/ejb/test/Cat.java
===================================================================
--- entitymanager/trunk/src/test/org/hibernate/ejb/test/Cat.java 2008-06-29 13:45:58 UTC
(rev 14823)
+++ entitymanager/trunk/src/test/org/hibernate/ejb/test/Cat.java 2008-06-29 13:47:11 UTC
(rev 14824)
@@ -9,10 +9,12 @@
import java.util.GregorianCalendar;
import java.util.List;
import javax.persistence.Basic;
+import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
+import javax.persistence.OneToMany;
import javax.persistence.PostLoad;
import javax.persistence.PostPersist;
import javax.persistence.PostUpdate;
@@ -20,12 +22,21 @@
import javax.persistence.TemporalType;
import javax.persistence.Transient;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
/**
* @author Emmanuel Bernard
*/
+@SuppressWarnings({"unchecked", "serial"})
@Entity
@EntityListeners( LastUpdateListener.class )
public class Cat implements Serializable {
+
+ private static final Logger log = LoggerFactory.getLogger(Cat.class);
+
+ private static final List ids = new ArrayList();
+
private Integer id;
private String name;
private Date dateOfBirth;
@@ -34,7 +45,7 @@
private Date lastUpdate;
private int manualVersion = 0;
private int postVersion = 0;
- private static final List ids = new ArrayList();
+ private List<Kitten> kittens;
@Id
@GeneratedValue
@@ -99,6 +110,7 @@
@PostUpdate
private void someLateUpdateWorking() {
+ log.debug("PostUpdate in Cat");
this.postVersion++;
}
@@ -131,4 +143,13 @@
public void setLength(long length) {
this.length = length;
}
+
+ @OneToMany(cascade = CascadeType.ALL)
+ public List<Kitten> getKittens() {
+ return kittens;
+ }
+
+ public void setKittens(List<Kitten> kittens) {
+ this.kittens = kittens;
+ }
}
Property changes on: entitymanager/trunk/src/test/org/hibernate/ejb/test/Cat.java
___________________________________________________________________
Name: svn:keywords
- Author Date Id Revision
+ Id
Added: entitymanager/trunk/src/test/org/hibernate/ejb/test/Kitten.java
===================================================================
--- entitymanager/trunk/src/test/org/hibernate/ejb/test/Kitten.java
(rev 0)
+++ entitymanager/trunk/src/test/org/hibernate/ejb/test/Kitten.java 2008-06-29 13:47:11
UTC (rev 14824)
@@ -0,0 +1,13 @@
+// $Id:$
+package org.hibernate.ejb.test;
+
+import javax.persistence.Entity;
+
+/**
+ * @author Hardy Ferentschik
+ */
+@SuppressWarnings("serial")
+@Entity
+public class Kitten extends Cat {
+
+}
Property changes on: entitymanager/trunk/src/test/org/hibernate/ejb/test/Kitten.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Modified:
entitymanager/trunk/src/test/org/hibernate/ejb/test/ejb3configuration/EntityManagerSerializationTest.java
===================================================================
---
entitymanager/trunk/src/test/org/hibernate/ejb/test/ejb3configuration/EntityManagerSerializationTest.java 2008-06-29
13:45:58 UTC (rev 14823)
+++
entitymanager/trunk/src/test/org/hibernate/ejb/test/ejb3configuration/EntityManagerSerializationTest.java 2008-06-29
13:47:11 UTC (rev 14824)
@@ -7,6 +7,7 @@
import java.io.ObjectOutput;
import java.io.ObjectOutputStream;
import java.util.Date;
+
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
@@ -14,6 +15,7 @@
import org.hibernate.ejb.test.Cat;
import org.hibernate.ejb.test.Distributor;
import org.hibernate.ejb.test.Item;
+import org.hibernate.ejb.test.Kitten;
import org.hibernate.ejb.test.Wallet;
/**
@@ -84,8 +86,8 @@
Item.class,
Distributor.class,
Wallet.class,
- Cat.class
-
+ Cat.class,
+ Kitten.class
};
}
}
Property changes on:
entitymanager/trunk/src/test/org/hibernate/ejb/test/ejb3configuration/EntityManagerSerializationTest.java
___________________________________________________________________
Name: svn:keywords
- Author Date Id Revision
+ Id
Modified:
entitymanager/trunk/src/test/org/hibernate/ejb/test/ejb3configuration/ProgrammaticConfTest.java
===================================================================
---
entitymanager/trunk/src/test/org/hibernate/ejb/test/ejb3configuration/ProgrammaticConfTest.java 2008-06-29
13:45:58 UTC (rev 14823)
+++
entitymanager/trunk/src/test/org/hibernate/ejb/test/ejb3configuration/ProgrammaticConfTest.java 2008-06-29
13:47:11 UTC (rev 14824)
@@ -1,16 +1,18 @@
-//$Id: $
+//$Id$
package org.hibernate.ejb.test.ejb3configuration;
import java.io.IOException;
import java.io.InputStream;
import java.util.Date;
import java.util.Properties;
+
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import org.hibernate.cfg.Environment;
import org.hibernate.ejb.Ejb3Configuration;
import org.hibernate.ejb.test.Cat;
+import org.hibernate.ejb.test.Kitten;
import org.hibernate.util.ConfigHelper;
/**
@@ -21,6 +23,7 @@
public void testProgrammaticAPI() throws Exception {
Ejb3Configuration conf = new Ejb3Configuration();
conf.addAnnotatedClass( Cat.class );
+ conf.addAnnotatedClass( Kitten.class );
EntityManagerFactory emf = conf.buildEntityManagerFactory();
EntityManager em = emf.createEntityManager();
Cat cat = new Cat();
Property changes on:
entitymanager/trunk/src/test/org/hibernate/ejb/test/ejb3configuration/ProgrammaticConfTest.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified:
entitymanager/trunk/src/test/org/hibernate/ejb/test/ejb3configuration/hibernate.cfg.xml
===================================================================
---
entitymanager/trunk/src/test/org/hibernate/ejb/test/ejb3configuration/hibernate.cfg.xml 2008-06-29
13:45:58 UTC (rev 14823)
+++
entitymanager/trunk/src/test/org/hibernate/ejb/test/ejb3configuration/hibernate.cfg.xml 2008-06-29
13:47:11 UTC (rev 14824)
@@ -5,5 +5,6 @@
<hibernate-configuration>
<session-factory>
<mapping class="org.hibernate.ejb.test.Cat"/>
+ <mapping class="org.hibernate.ejb.test.Kitten"/>
</session-factory>
</hibernate-configuration>
\ No newline at end of file
Modified: entitymanager/trunk/src/test/org/hibernate/ejb/test/hibernate.cfg.xml
===================================================================
--- entitymanager/trunk/src/test/org/hibernate/ejb/test/hibernate.cfg.xml 2008-06-29
13:45:58 UTC (rev 14823)
+++ entitymanager/trunk/src/test/org/hibernate/ejb/test/hibernate.cfg.xml 2008-06-29
13:47:11 UTC (rev 14824)
@@ -19,6 +19,7 @@
<property
name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
<mapping class="org.hibernate.ejb.test.Item"/>
<mapping class="org.hibernate.ejb.test.Cat"/>
+ <mapping class="org.hibernate.ejb.test.Kitten"/>
<mapping class="org.hibernate.ejb.test.Distributor"/>
<class-cache class="org.hibernate.ejb.test.Item"
usage="read-write"/>
<collection-cache
collection="org.hibernate.ejb.test.Item.distributors"
usage="read-write" region="RegionName"/>
Modified:
entitymanager/trunk/src/test-resources/cfgxmlpar/org/hibernate/ejb/test/pack/cfgxmlpar/hibernate.cfg.xml
===================================================================
---
entitymanager/trunk/src/test-resources/cfgxmlpar/org/hibernate/ejb/test/pack/cfgxmlpar/hibernate.cfg.xml 2008-06-29
13:45:58 UTC (rev 14823)
+++
entitymanager/trunk/src/test-resources/cfgxmlpar/org/hibernate/ejb/test/pack/cfgxmlpar/hibernate.cfg.xml 2008-06-29
13:47:11 UTC (rev 14824)
@@ -19,6 +19,7 @@
<property
name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
<mapping class="org.hibernate.ejb.test.Item"/>
<mapping class="org.hibernate.ejb.test.Cat"/>
+ <mapping class="org.hibernate.ejb.test.Kitten"/>
<mapping class="org.hibernate.ejb.test.Distributor"/>
<class-cache class="org.hibernate.ejb.test.Item"
usage="read-write"/>
<collection-cache
collection="org.hibernate.ejb.test.Item.distributors"
usage="read-write" region="RegionName"/>
Modified: entitymanager/trunk/src/test-resources/explicitpar/META-INF/persistence.xml
===================================================================
--- entitymanager/trunk/src/test-resources/explicitpar/META-INF/persistence.xml 2008-06-29
13:45:58 UTC (rev 14823)
+++ entitymanager/trunk/src/test-resources/explicitpar/META-INF/persistence.xml 2008-06-29
13:47:11 UTC (rev 14824)
@@ -6,6 +6,7 @@
<persistence-unit name="manager1"
transaction-type="RESOURCE_LOCAL">
<jar-file>./build/testresources/externaljar.jar</jar-file>
<class>org.hibernate.ejb.test.Cat</class>
+ <class>org.hibernate.ejb.test.Kitten</class>
<class>org.hibernate.ejb.test.Distributor</class>
<class>org.hibernate.ejb.test.Item</class>
<class>org.hibernate.ejb.test</class>
Show replies by date