* Store m-side and intermediary
*/
public void testStoringWithAutoUpdateFalse1()
{
ClassDescriptor cld = broker.getClassDescriptor(Paper.class);
CollectionDescriptor cod = cld.getCollectionDescriptorByName("qualifiers");
int autoUpdate = cod.getCascadingStore();
cod.setCascadingStore(ObjectReferenceDescriptor.CASCADE_LINK);
try
{
String now = new Date().toString();
Paper paper = new Paper();
paper.setAuthor("Jonny Myers");
paper.setDate(now);
Qualifier qual = new Topic();
qual.setName("qual " + now);
paper.setQualifiers(Arrays.asList(new Qualifier[] { qual }));
broker.beginTransaction();
// TODO: use constraint in DB and fix test
// store paper and set indirection table, ignore new Qualifier
// object. Will cause Key Constraint Exception when constraint are set
broker.store(paper);
Identity paperId = new Identity(paper, broker);
broker.commitTransaction();
broker.clearCache();
broker.beginTransaction();
Paper retPaper = (Paper) broker.getObjectByIdentity(paperId);
assertEquals(0, retPaper.getQualifiers().size());
broker.commitTransaction();
}
finally
{
cod.setCascadingStore(autoUpdate);
}
}