| |
|
| org.apache.ojb.junit.PBTestCase org.apache.ojb.broker.ReferenceTest
ReferenceTest | public class ReferenceTest extends PBTestCase (Code) | | Test case for checking the management of references.
author: Armin Waibel version: $Id: ReferenceTest.java,v 1.17.2.4 2005/10/06 15:21:41 arminw Exp $ |
Inner Class :public static class Repository implements Serializable | |
Inner Class :public static class RepositoryFK extends Repository | |
Inner Class :public static interface ReferenceIF extends Serializable | |
Inner Class :public static interface ReferenceAIF extends Serializable | |
Inner Class :public static interface ReferenceBIF extends Serializable | |
Inner Class :public static class Reference implements ReferenceIF | |
Inner Class :public static class ReferenceA extends Reference implements ReferenceAIF | |
Inner Class :public static class ReferenceB extends Reference implements ReferenceBIF | |
Inner Class :abstract public static class Animal | |
Inner Class :public static class Mammal extends Animal | |
Inner Class :public static class Bird extends Animal | |
Inner Class :public static class Fish extends Animal | |
Inner Class :public static class Wine | |
Inner Class :public static class Region | |
Inner Class :public static interface RefObject | |
Inner Class :public static class ObjA implements RefObject | |
Inner Class :public static class ObjB extends ObjA | |
Inner Class :public static class ObjC extends ObjA | |
tearDown | public void tearDown()(Code) | | |
testAbstractReferenceDelete | public void testAbstractReferenceDelete() throws Exception(Code) | | this test case use an abstract class as reference
throws: Exception - |
testAbstractReferenceQuery | public void testAbstractReferenceQuery() throws Exception(Code) | | |
testAbstractReferenceStore | public void testAbstractReferenceStore() throws Exception(Code) | | this test case use an abstract class as reference
throws: Exception - |
testAutoUpdateDeleteSettings | public void testAutoUpdateDeleteSettings()(Code) | | |
testDeepPathQuery | public void testDeepPathQuery()(Code) | | |
testDeleteReferencesMappedToSameTable | public void testDeleteReferencesMappedToSameTable()(Code) | | |
testDeleteReferencesMappedToSameTable_2 | public void testDeleteReferencesMappedToSameTable_2()(Code) | | |
testDeleteReferencesMappedToSameTable_3 | public void testDeleteReferencesMappedToSameTable_3()(Code) | | |
testDeleteWithMultiplePK | public void testDeleteWithMultiplePK()(Code) | | |
testGetReferencesByIdentityMappedToSameTable | public void testGetReferencesByIdentityMappedToSameTable()(Code) | | |
testHandlingOfMultiplePKFields | public void testHandlingOfMultiplePKFields() throws Exception(Code) | | not really a reference test, here we check handling of objects
with multiple PK fields. Such an object was used in following
reference tests.
|
testInterfaceAsCollectionRef_1 | public void testInterfaceAsCollectionRef_1()(Code) | | Test the usage of interface as class-ref in collection-descriptor
when using inheritance.
|
testInterfaceAsCollectionRef_2 | public void testInterfaceAsCollectionRef_2()(Code) | | Test the usage of interface as class-ref in collection-descriptor
when using inheritance.
|
testMassOperations | public void testMassOperations()(Code) | | |
testQueryExtentsWithAutoRefreshEnabled | public void testQueryExtentsWithAutoRefreshEnabled() throws Exception(Code) | | Test for OJB-49
|
testQueryReferencesMappedToSameTable | public void testQueryReferencesMappedToSameTable()(Code) | | |
testRepositoryFKStore | public void testRepositoryFKStore()(Code) | | This test does the same as the
ReferenceTest.testRepositoryFKStore ,
but the used mapping data differ.
RepositoryFK defines all the reference fields as
primary key in field-descriptors. Further on the used
database table declares the reference fields as PK too.
Based on a user post:
> The following fails to be stored by PersistenceBroker:
>
> I have a class ACL which has two primary keys: objectId and userFK, and
> userFK is also a foreign key tied to a reference of type User. If I do
this:
>
> persistentBroker.beginTransaction();
> ACL acl = new ACL();
> acl.setObjectId( 100 );
> acl.setUser( currentUser );
> persistentBroker.store(acl);
> persistentBroker.commitTransaction();
>
> Acl will not be saved. The reason seems to be because in the storeToDb()
> method of the PersistentBroker, there first comes an assertion of the
> PrimaryKeys and afterwards comes the assignment of all the foreign keys.
In
> the scenario above the assertion of the primary keys will fail, because
the
> userFK has not been assigned yet, so we have an incomplete set of primary
> keys. This does work with the ODMG layer, probably because of a different
> sequence of events during the storing of the object.
>
> I wonder if there should be a check whether a primary key is shared by the
> foreign key and allow that assignment before the assertion of the primary
> keys is performed. Any ideas?
>
> Cheers,
> --Bill.
|
testStoreReferencesMappedToSameTable | public void testStoreReferencesMappedToSameTable()(Code) | | |
testStoreWithMultiplePK_1 | public void testStoreWithMultiplePK_1() throws Exception(Code) | | |
testStoreWithMultiplePK_2 | public void testStoreWithMultiplePK_2() throws Exception(Code) | | |
testStoreWithMultiplePK_3 | public void testStoreWithMultiplePK_3() throws Exception(Code) | | |
|
|
|