Package ejava.examples.orm.onetomany
Class OneManyUnidirectionalTest
- java.lang.Object
-
- ejava.examples.orm.rel.DemoBase
-
- ejava.examples.orm.onetomany.OneManyUnidirectionalTest
-
public class OneManyUnidirectionalTest extends DemoBase
-
-
Constructor Summary
Constructors Constructor Description OneManyUnidirectionalTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
cleanup()
This method will cleanup the database of our OneToMany entities.protected void
precleanup()
void
testOneToManyOwningParent()
This method tests the case where the parent owns the relationship.-
Methods inherited from class ejava.examples.orm.rel.DemoBase
postcleanup, setUpBase, setUpDownShared, tearDownBase, tearDownBaseClass
-
-
-
-
Method Detail
-
precleanup
protected void precleanup() throws Exception
- Overrides:
precleanup
in classDemoBase
- Throws:
Exception
-
cleanup
protected void cleanup() throws Exception
This method will cleanup the database of our OneToMany entities. We start with the owning entities, since they own the foreign keys or the link/join tables with the foreign keys. Once the associations have been deleted, all inverse and oblivious entities can be safely removed.- Throws:
Exception
-
testOneToManyOwningParent
public void testOneToManyOwningParent()
This method tests the case where the parent owns the relationship. Since children in a one-to-many relationship are required by JPA to own the relationship, we can only test this with children that know nothing of the parent. In this case, there is only an owning side.
-
-