Author: adamw
Date: 2008-07-16 03:25:27 -0400 (Wed, 16 Jul 2008)
New Revision: 92
Modified:
trunk/src/test/org/jboss/envers/test/working/WorkingEntity1.java
trunk/src/test/org/jboss/envers/test/working/WorkingEntity2.java
trunk/src/test/org/jboss/envers/test/working/WorkingMain.java
Log:
Cleanup
Modified: trunk/src/test/org/jboss/envers/test/working/WorkingEntity1.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/working/WorkingEntity1.java 2008-07-16 07:22:43
UTC (rev 91)
+++ trunk/src/test/org/jboss/envers/test/working/WorkingEntity1.java 2008-07-16 07:25:27
UTC (rev 92)
@@ -25,10 +25,10 @@
//@Column(table = "second_table", name = "cc_second")
private String cc;
- //@Versioned
+ @Versioned
//@OneToOne
- //@ManyToOne
- @Transient
+ @ManyToOne
+ //@Transient
private WorkingEntity2 we2;
public WorkingEntity1() {
Modified: trunk/src/test/org/jboss/envers/test/working/WorkingEntity2.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/working/WorkingEntity2.java 2008-07-16 07:22:43
UTC (rev 91)
+++ trunk/src/test/org/jboss/envers/test/working/WorkingEntity2.java 2008-07-16 07:25:27
UTC (rev 92)
@@ -21,8 +21,8 @@
private String str2;
@Versioned
- //@OneToMany(mappedBy = "we2")
- @ManyToMany
+ @OneToMany(mappedBy = "we2")
+ //@ManyToMany
//@Transient
private Set<WorkingEntity1> we1s;
Modified: trunk/src/test/org/jboss/envers/test/working/WorkingMain.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/working/WorkingMain.java 2008-07-16 07:22:43 UTC
(rev 91)
+++ trunk/src/test/org/jboss/envers/test/working/WorkingMain.java 2008-07-16 07:25:27 UTC
(rev 92)
@@ -20,10 +20,7 @@
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import java.io.IOException;
-import java.util.List;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.HashSet;
+import java.util.*;
/**
* @author Adam Warski (adam at warski dot org)
@@ -60,58 +57,9 @@
// Rev 1
entityManager.getTransaction().begin();
- WorkingEntity2 we2 = new WorkingEntity2();
- entityManager.persist(we2);
- entityManager.getTransaction().commit();
- // Rev 2
- entityManager.getTransaction().begin();
-
- we2 = entityManager.find(WorkingEntity2.class, we2.getId2());
-
- WorkingEntity1 we1 = new WorkingEntity1();
- we1.setWe2(we2);
- entityManager.persist(we1);
-
- entityManager.getTransaction().commit();
-
- /*
- // Rev 2
- entityManager.getTransaction().begin();
-
- se1 = entityManager.find(SubEntity.class, se1.getId());
- se1.setData("y");
- se1.setNumber(20l);
-
- entityManager.getTransaction().commit();
-
- // Test
- VersionsReader vr = VersionsReaderFactory.get(entityManager);*/
- //System.out.println(vr.find(SubEntity.class, se1.getId(), 1));
-
- /*
- cfg.addResource("org/jboss/envers/test/working/test.hbm.xml");
- Session session = getSession(entityManager);
-
- session.getTransaction().begin();
-
- Map test1 = new HashMap();
- test1.put("dataA", "a");
- session.persist("Superclass", test1);
-
- Map test2 = new HashMap();
- test2.put("dataB", "b");
- session.persist("Subclass", test2);
-
- session.getTransaction().commit();
-
- session.getTransaction().begin();
-
- System.out.println(session.createQuery("select s from Superclass
s").list());
- System.out.println(session.createQuery("select s from Subclass
s").list());
-
- session.getTransaction().commit(); */
+ entityManager.getTransaction().commit();
}
}
Show replies by date