use of org.datanucleus.api.jdo.metadata.JDOMetaDataManager in project tests by datanucleus.
the class BasicTest method testFieldForeignKeyMetadata.
/**
* Tests the foreign key declared in many forms
*/
public void testFieldForeignKeyMetadata() {
MetaDataManager mgr = new JDOMetaDataManager(new PersistenceNucleusContextImpl("JDO", null));
mgr.setValidate(false);
AbstractClassMetaData cmdD0 = mgr.getMetaDataForClass(D0.class, new ClassLoaderResolverImpl());
AbstractClassMetaData cmdD1 = mgr.getMetaDataForClass(D1.class, new ClassLoaderResolverImpl());
AbstractClassMetaData cmdD2 = mgr.getMetaDataForClass(D2.class, new ClassLoaderResolverImpl());
AbstractClassMetaData cmdD3 = mgr.getMetaDataForClass(D3.class, new ClassLoaderResolverImpl());
AbstractClassMetaData cmdD4 = mgr.getMetaDataForClass(D4.class, new ClassLoaderResolverImpl());
AbstractClassMetaData cmdD5 = mgr.getMetaDataForClass(D5.class, new ClassLoaderResolverImpl());
// Foreign Key name
assertEquals("FK1", cmdD0.getMetaDataForManagedMemberAtAbsolutePosition(cmdD0.getAbsolutePositionOfMember("name")).getForeignKeyMetaData().getName());
assertEquals(cmdD0.getMetaDataForManagedMemberAtAbsolutePosition(cmdD0.getAbsolutePositionOfMember("name")).getForeignKeyMetaData().getName(), cmdD1.getMetaDataForManagedMemberAtAbsolutePosition(cmdD1.getAbsolutePositionOfMember("name")).getForeignKeyMetaData().getName());
assertEquals(cmdD0.getMetaDataForManagedMemberAtAbsolutePosition(cmdD0.getAbsolutePositionOfMember("name")).getForeignKeyMetaData().getName(), cmdD2.getMetaDataForManagedMemberAtAbsolutePosition(cmdD2.getAbsolutePositionOfMember("name")).getForeignKeyMetaData().getName());
assertEquals(cmdD0.getMetaDataForManagedMemberAtAbsolutePosition(cmdD0.getAbsolutePositionOfMember("name")).getForeignKeyMetaData().getName(), cmdD3.getMetaDataForManagedMemberAtAbsolutePosition(cmdD3.getAbsolutePositionOfMember("name")).getForeignKeyMetaData().getName());
assertEquals(cmdD0.getMetaDataForManagedMemberAtAbsolutePosition(cmdD0.getAbsolutePositionOfMember("name")).getForeignKeyMetaData().getName(), cmdD4.getMetaDataForManagedMemberAtAbsolutePosition(cmdD4.getAbsolutePositionOfMember("name")).getForeignKeyMetaData().getName());
assertEquals(cmdD0.getMetaDataForManagedMemberAtAbsolutePosition(cmdD0.getAbsolutePositionOfMember("name")).getForeignKeyMetaData().getName(), cmdD5.getMetaDataForManagedMemberAtAbsolutePosition(cmdD5.getAbsolutePositionOfMember("name")).getForeignKeyMetaData().getName());
// Foreign Key delete action
assertEquals(ForeignKeyAction.CASCADE.toString(), cmdD4.getMetaDataForManagedMemberAtAbsolutePosition(cmdD4.getAbsolutePositionOfMember("name")).getForeignKeyMetaData().getDeleteAction().toString());
// D5 should be "restrict" since the DTD imposes a default of "restrict" when specifying the <foreign-key/> element so the
// "delete-action" attribute is ignored.
assertEquals(ForeignKeyAction.RESTRICT.toString(), cmdD5.getMetaDataForManagedMemberAtAbsolutePosition(cmdD5.getAbsolutePositionOfMember("name")).getForeignKeyMetaData().getDeleteAction().toString());
}
use of org.datanucleus.api.jdo.metadata.JDOMetaDataManager in project tests by datanucleus.
the class BasicTest method testPrimaryKeyMetadata.
/**
* Tests the primary key
*/
public void testPrimaryKeyMetadata() {
MetaDataManager mgr = new JDOMetaDataManager(new PersistenceNucleusContextImpl("JDO", null));
mgr.setValidate(false);
AbstractClassMetaData cmdD0 = mgr.getMetaDataForClass(D0.class, new ClassLoaderResolverImpl());
// Primary Key name
assertEquals("THED0_PK", cmdD0.getPrimaryKeyMetaData().getName());
}
use of org.datanucleus.api.jdo.metadata.JDOMetaDataManager in project tests by datanucleus.
the class FetchPlanTest method testNestedFetchGroupsAgain.
/**
* Test nested fetch groups.
* TODO Merge this with the test above
*/
public void testNestedFetchGroupsAgain() {
FetchPlan fp = getFetchPlan();
PersistenceNucleusContextImpl nucleusCtx = new PersistenceNucleusContextImpl("JDO", null);
MetaDataManager metaMgr = new JDOMetaDataManager(nucleusCtx);
// test parent with fetch-group = group1
AbstractClassMetaData cmd = metaMgr.getMetaDataForClass(FP1Sub.class, new ClassLoaderResolverImpl());
fp.addGroup("1");
fp.removeGroup(FetchPlan.DEFAULT);
FetchPlanForClass fpc = fp.getFetchPlanForClass(cmd);
int[] fieldsInFP = fpc.getMemberNumbers();
assertEquals("should have 2 fields in fetchplan", 2, fieldsInFP.length);
// check if fields are in the FP
BitSet fieldsInFPBitSet = fpc.getMemberNumbersByBitSet();
assertTrue("name should be in the fetchplan", fieldsInFPBitSet.get(cmd.getAbsolutePositionOfMember("name")));
assertTrue("room should be in the fetchplan", fieldsInFPBitSet.get(cmd.getAbsolutePositionOfMember("room")));
}
use of org.datanucleus.api.jdo.metadata.JDOMetaDataManager in project tests by datanucleus.
the class FetchPlanTest method testPostLoad.
/**
* Test the use of "postload"
*/
public void testPostLoad() throws Exception {
FetchPlan fp = getFetchPlan();
PersistenceNucleusContextImpl nucleusCtx = new PersistenceNucleusContextImpl("JDO", null);
MetaDataManager metaMgr = new JDOMetaDataManager(nucleusCtx);
AbstractClassMetaData cmd = metaMgr.getMetaDataForClass(FP2Base.class, new ClassLoaderResolverImpl());
// --------------------------------------
// all fields in DFG
// --------------------------------------
FetchPlanForClass fpc = fp.getFetchPlanForClass(cmd);
boolean[] loadedFields = new boolean[14];
loadedFields[cmd.getAbsolutePositionOfMember("piece1")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece2")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece3")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece4")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece5")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece6")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece7")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece8")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece9")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece10")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece11")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece12")] = true;
assertFalse("Should not call postLoad callback", fpc.isToCallPostLoadFetchPlan(loadedFields));
loadedFields[cmd.getAbsolutePositionOfMember("piece1")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece2")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece3")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece4")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece5")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece6")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece7")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece8")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece9")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece10")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece11")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece12")] = false;
assertFalse("Should not call postLoad callback", fpc.isToCallPostLoadFetchPlan(loadedFields));
loadedFields[cmd.getAbsolutePositionOfMember("piece1")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece2")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece3")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece4")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece5")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece6")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece7")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece8")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece9")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece10")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece11")] = false;
loadedFields[cmd.getAbsolutePositionOfMember("piece12")] = false;
assertTrue("Should call postLoad callback", fpc.isToCallPostLoadFetchPlan(loadedFields));
// --------------------------------------
// fetch group width postLoad + DFG
// --------------------------------------
fp.addGroup("groupD");
fpc = fp.getFetchPlanForClass(cmd);
loadedFields[cmd.getAbsolutePositionOfMember("piece1")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece2")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece3")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece4")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece5")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece6")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece7")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece8")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece9")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece10")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece11")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece12")] = true;
assertFalse("Should not call postLoad callback", fpc.isToCallPostLoadFetchPlan(loadedFields));
loadedFields[cmd.getAbsolutePositionOfMember("piece1")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece2")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece3")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece4")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece5")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece6")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece7")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece8")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece9")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece10")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece11")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece12")] = false;
assertTrue("Should call postLoad callback", fpc.isToCallPostLoadFetchPlan(loadedFields));
loadedFields[cmd.getAbsolutePositionOfMember("piece1")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece2")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece3")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece4")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece5")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece6")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece7")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece8")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece9")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece10")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece11")] = false;
loadedFields[cmd.getAbsolutePositionOfMember("piece12")] = false;
assertTrue("Should call postLoad callback", fpc.isToCallPostLoadFetchPlan(loadedFields));
// --------------------------------------
// fetch group width postLoad
// --------------------------------------
fp.addGroup("groupD");
fp.removeGroup(FetchPlan.DEFAULT);
fpc = fp.getFetchPlanForClass(cmd);
loadedFields[cmd.getAbsolutePositionOfMember("piece1")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece2")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece3")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece4")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece5")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece6")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece7")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece8")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece9")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece10")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece11")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece12")] = true;
assertFalse("Should not call postLoad callback", fpc.isToCallPostLoadFetchPlan(loadedFields));
loadedFields[cmd.getAbsolutePositionOfMember("piece1")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece2")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece3")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece4")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece5")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece6")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece7")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece8")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece9")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece10")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece11")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece12")] = false;
assertTrue("Should call postLoad callback", fpc.isToCallPostLoadFetchPlan(loadedFields));
loadedFields[cmd.getAbsolutePositionOfMember("piece1")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece2")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece3")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece4")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece5")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece6")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece7")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece8")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece9")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece10")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece11")] = false;
loadedFields[cmd.getAbsolutePositionOfMember("piece12")] = false;
assertTrue("Should call postLoad callback", fpc.isToCallPostLoadFetchPlan(loadedFields));
loadedFields[cmd.getAbsolutePositionOfMember("piece1")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece2")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece3")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece4")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece5")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece6")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece7")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece8")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece9")] = false;
loadedFields[cmd.getAbsolutePositionOfMember("piece10")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece11")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece12")] = true;
assertFalse("Should not call postLoad callback", fpc.isToCallPostLoadFetchPlan(loadedFields));
// --------------------------------------
// fetch group without postLoad
// --------------------------------------
fp.addGroup("groupC");
fp.removeGroup("groupD");
fp.removeGroup(FetchPlan.DEFAULT);
fpc = fp.getFetchPlanForClass(cmd);
loadedFields[cmd.getAbsolutePositionOfMember("piece1")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece2")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece3")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece4")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece5")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece6")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece7")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece8")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece9")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece10")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece11")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece12")] = true;
assertFalse("Should not call postLoad callback", fpc.isToCallPostLoadFetchPlan(loadedFields));
loadedFields[cmd.getAbsolutePositionOfMember("piece1")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece2")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece3")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece4")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece5")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece6")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece7")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece8")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece9")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece10")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece11")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece12")] = false;
assertFalse("Should call postLoad callback", fpc.isToCallPostLoadFetchPlan(loadedFields));
loadedFields[cmd.getAbsolutePositionOfMember("piece1")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece2")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece3")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece4")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece5")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece6")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece7")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece8")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece9")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece10")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece11")] = false;
loadedFields[cmd.getAbsolutePositionOfMember("piece12")] = false;
assertFalse("Should not call postLoad callback", fpc.isToCallPostLoadFetchPlan(loadedFields));
loadedFields[cmd.getAbsolutePositionOfMember("piece1")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece2")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece3")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece4")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece5")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece6")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece7")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece8")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece9")] = false;
loadedFields[cmd.getAbsolutePositionOfMember("piece10")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece11")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece12")] = true;
assertFalse("Should not call postLoad callback", fpc.isToCallPostLoadFetchPlan(loadedFields));
// --------------------------------------
// fetch group width postLoad
// --------------------------------------
fp.addGroup("groupAll");
fp.removeGroup("groupC");
fp.removeGroup(FetchPlan.DEFAULT);
fpc = fp.getFetchPlanForClass(cmd);
loadedFields[cmd.getAbsolutePositionOfMember("piece1")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece2")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece3")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece4")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece5")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece6")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece7")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece8")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece9")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece10")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece11")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece12")] = true;
assertFalse("Should not call postLoad callback", fpc.isToCallPostLoadFetchPlan(loadedFields));
loadedFields[cmd.getAbsolutePositionOfMember("piece1")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece2")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece3")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece4")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece5")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece6")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece7")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece8")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece9")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece10")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece11")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece12")] = false;
assertTrue("Should call postLoad callback", fpc.isToCallPostLoadFetchPlan(loadedFields));
loadedFields[cmd.getAbsolutePositionOfMember("piece1")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece2")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece3")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece4")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece5")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece6")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece7")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece8")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece9")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece10")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece11")] = false;
loadedFields[cmd.getAbsolutePositionOfMember("piece12")] = false;
assertTrue("Should call postLoad callback", fpc.isToCallPostLoadFetchPlan(loadedFields));
loadedFields[cmd.getAbsolutePositionOfMember("piece1")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece2")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece3")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece4")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece5")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece6")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece7")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece8")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece9")] = false;
loadedFields[cmd.getAbsolutePositionOfMember("piece10")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece11")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece12")] = true;
assertFalse("Should not call postLoad callback", fpc.isToCallPostLoadFetchPlan(loadedFields));
}
use of org.datanucleus.api.jdo.metadata.JDOMetaDataManager in project tests by datanucleus.
the class AnnotationTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
nucleusCtx = new PersistenceNucleusContextImpl("JDO", null);
metaDataMgr = new JDOMetaDataManager(nucleusCtx);
clr = new ClassLoaderResolverImpl();
}
Aggregations