HHH-8374 test case
This commit is contained in:
parent
05c078e459
commit
a71eb4786a
|
@ -23,16 +23,16 @@
|
||||||
*/
|
*/
|
||||||
package org.hibernate.test.reattachment;
|
package org.hibernate.test.reattachment;
|
||||||
|
|
||||||
|
import static org.junit.Assert.assertEquals;
|
||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
import org.hibernate.Session;
|
import org.hibernate.Session;
|
||||||
|
import org.hibernate.testing.TestForIssue;
|
||||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||||
|
import org.junit.Test;
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test of proxy reattachment semantics
|
* Test of proxy reattachment semantics
|
||||||
|
@ -250,4 +250,24 @@ public class ProxyReattachmentTest extends BaseCoreFunctionalTestCase {
|
||||||
s.getTransaction().commit();
|
s.getTransaction().commit();
|
||||||
s.close();
|
s.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestForIssue(jiraKey = "HHH-8374")
|
||||||
|
public void testRemoveAndReattachProxyEntity() {
|
||||||
|
Session s = openSession();
|
||||||
|
s.beginTransaction();
|
||||||
|
Parent p = new Parent("foo");
|
||||||
|
s.persist( p );
|
||||||
|
s.getTransaction().commit();
|
||||||
|
s.close();
|
||||||
|
|
||||||
|
s = openSession();
|
||||||
|
s.beginTransaction();
|
||||||
|
p = (Parent) s.load( Parent.class, p.getName() );
|
||||||
|
s.delete( p );
|
||||||
|
// re-attach
|
||||||
|
s.persist( p );
|
||||||
|
s.getTransaction().commit();
|
||||||
|
s.close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue