// polytomous key
// |- root : polytomous key node
// in a recursive call
- PolytomousKey pkey1 = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH1_INIT_STRATEGY),PolytomousKey.class);
+ PolytomousKey pkey1 = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH1_INIT_STRATEGY));
// checking to make sure the root object is in the session cache
Assert.assertSame(CdmBase.deproxy(pkey1.getRoot(),PolytomousKeyNode.class), cacher.getFromCache(pkey1.getRoot()));
// |- question : KeyStatement
// |- statement : KeyStatement
// in a recursive call
- PolytomousKey pkey = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH2_INIT_STRATEGY),PolytomousKey.class);
+ PolytomousKey pkey = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH2_INIT_STRATEGY));
CdmTransientEntityCacher cacher = getCacher(sessionOwner);
// checking to make sure the root object is in the session cache
- Assert.assertSame(CdmBase.deproxy(pkey.getRoot(),PolytomousKeyNode.class), cacher.getFromCache(pkey.getRoot()));
- Assert.assertSame(CdmBase.deproxy(pkey.getRoot().getStatement(),KeyStatement.class), cacher.getFromCache(pkey.getRoot().getStatement()));
- Assert.assertSame(CdmBase.deproxy(pkey.getRoot().getQuestion(),KeyStatement.class), cacher.getFromCache(pkey.getRoot().getQuestion()));
+ Assert.assertSame(CdmBase.deproxy(pkey.getRoot()), cacher.getFromCache(pkey.getRoot()));
+ Assert.assertSame(CdmBase.deproxy(pkey.getRoot().getStatement()), cacher.getFromCache(pkey.getRoot().getStatement()));
+ Assert.assertSame(CdmBase.deproxy(pkey.getRoot().getQuestion()), cacher.getFromCache(pkey.getRoot().getQuestion()));
}
// |- root : polytomous key node
// |- question : KeyStatement
// |- statement : KeyStatement
- PolytomousKey pkey1 = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid),PolytomousKey.class);
+ PolytomousKey pkey1 = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid));
CdmTransientEntityCacher cacher = getCacher(sessionOwner);
}
// polytomous key
// |- root : polytomous key node
// in a recursive call
- PolytomousKey pkey1 = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH1_INIT_STRATEGY),PolytomousKey.class);
- KeyStatement ks1 = CdmBase.deproxy(pkey1.getRoot().getStatement(), KeyStatement.class);
+ PolytomousKey pkey1 = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH1_INIT_STRATEGY));
+ KeyStatement ks1 = CdmBase.deproxy(pkey1.getRoot().getStatement());
CdmTransientEntityCacher cacher = getCacher(sessionOwner);
// |- root : polytomous key node
// |- question : KeyStatement
// |- statement : KeyStatement
- PolytomousKey pkey2 = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH3_INIT_STRATEGY),PolytomousKey.class);
+ PolytomousKey pkey2 = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH3_INIT_STRATEGY));
- KeyStatement ks2 = CdmBase.deproxy(pkey2.getRoot().getStatement(), KeyStatement.class);
+ KeyStatement ks2 = CdmBase.deproxy(pkey2.getRoot().getStatement());
Assert.assertSame(ks2, cacher.getFromCache(ks2));
Assert.assertSame(cacher.getFromCache(ks1), cacher.getFromCache(ks2));
// |- root : polytomous key node
// |- question : KeyStatement
// |- statement : KeyStatement
- PolytomousKey pkey1 = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH2_INIT_STRATEGY),PolytomousKey.class);
+ PolytomousKey pkey1 = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH2_INIT_STRATEGY));
KeyStatement ks1 = pkey1.getRoot().getStatement();
Assert.assertSame(ks1, pkey1.getRoot().getStatement());
CdmTransientEntityCacher cacher = getCacher(sessionOwner);
// this call will load into the session cache the graph and update the objects in the sub-graph for a
// polytomous key
// |- root : polytomous key node
- PolytomousKey pkey2 = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH1_INIT_STRATEGY),PolytomousKey.class);
+ PolytomousKey pkey2 = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH1_INIT_STRATEGY));
Assert.assertSame(pkey1.getRoot().getStatement(), pkey2.getRoot().getStatement());
pkey2.getRoot().getStatement().getCreatedBy();
// |- root : polytomous key node
// |- question : KeyStatement
// |- statement : KeyStatement
- PolytomousKey pkey1 = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH2_INIT_STRATEGY),PolytomousKey.class);
+ PolytomousKey pkey1 = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH2_INIT_STRATEGY));
CdmTransientEntityCacher cacher = getCacher(sessionOwner);
// that it exists in the cache and
// that both the original object and the
// cached object are the same
- Assert.assertNotNull(CdmBase.deproxy(pkey1.getRoot().getStatement(), KeyStatement.class));
+ Assert.assertNotNull(CdmBase.deproxy(pkey1.getRoot().getStatement()));
Assert.assertNotNull(cacher.getFromCache(pkey1.getRoot().getStatement()));
// this call will load into the session cache the graph and update the objects in the sub-graph for a
// polytomous key
// |- root : polytomous key node
- PolytomousKey pkey2 = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid),PolytomousKey.class);
+ PolytomousKey pkey2 = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid));
- KeyStatement ks2 = CdmBase.deproxy(pkey2.getRoot().getStatement(), KeyStatement.class);
+ KeyStatement ks2 = CdmBase.deproxy(pkey2.getRoot().getStatement());
Assert.assertSame(ks2, cacher.getFromCache(pkey2.getRoot().getStatement()));
Assert.assertSame(pkey1.getRoot().getStatement(), pkey2.getRoot().getStatement());
// polytomous key
// |- root : polytomous key node
- PolytomousKey pkey1 = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid),PolytomousKey.class);
+ PolytomousKey pkey1 = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid));
// lazy initialising root.statement
- KeyStatement st = CdmBase.deproxy(pkey1.getRoot().getStatement(), KeyStatement.class);
+ KeyStatement st = CdmBase.deproxy(pkey1.getRoot().getStatement());
st.getLabel();
// checking that the root is not null and
// that both the original object and the
// cached object are the same
Assert.assertNotNull(pkey1.getRoot().getStatement());
- Assert.assertSame(CdmBase.deproxy(pkey1.getRoot().getStatement(), KeyStatement.class),
- cacher.getFromCache(pkey1.getRoot().getStatement(), KeyStatement.class));
+ Assert.assertSame(CdmBase.deproxy(pkey1.getRoot().getStatement()),
+ cacher.getFromCache(pkey1.getRoot().getStatement()));
// this call will load into the session cache the graph and update the objects in the sub-graph for a
// polytomous key
// |- question : KeyStatement
// |- statement : KeyStatement
- PolytomousKey pkey2 = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH2_INIT_STRATEGY),PolytomousKey.class);
+ PolytomousKey pkey2 = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH2_INIT_STRATEGY));
- Assert.assertSame(CdmBase.deproxy(pkey2.getRoot().getStatement(), KeyStatement.class), cacher.getFromCache(pkey2.getRoot().getStatement(), KeyStatement.class));
- Assert.assertSame(st, CdmBase.deproxy(pkey2.getRoot().getStatement(), KeyStatement.class));
- Assert.assertSame(cacher.getFromCache(st), cacher.getFromCache(pkey2.getRoot().getStatement(), KeyStatement.class));
+ Assert.assertSame(CdmBase.deproxy(pkey2.getRoot().getStatement(), KeyStatement.class), cacher.getFromCache(pkey2.getRoot().getStatement()));
+ Assert.assertSame(st, CdmBase.deproxy(pkey2.getRoot().getStatement()));
+ Assert.assertSame(cacher.getFromCache(st), cacher.getFromCache(pkey2.getRoot().getStatement()));
}
public void subGraphObjectLoadTest1() {
// this call will load into the session cache a polytomous key node object
- PolytomousKeyNode rootPKNode = CdmBase.deproxy(polytomousKeyNodeService.find(polytomousKeyNodeUuid1),PolytomousKeyNode.class);
+ PolytomousKeyNode rootPKNode = CdmBase.deproxy(polytomousKeyNodeService.find(polytomousKeyNodeUuid1));
Assert.assertNotNull(rootPKNode);
Assert.assertSame(rootPKNode, cacher.getFromCache(rootPKNode));
- PolytomousKeyNode childOfRootPKNode = CdmBase.deproxy(polytomousKeyNodeService.find(polytomousKeyNodeUuid2),PolytomousKeyNode.class);
+ PolytomousKeyNode childOfRootPKNode = CdmBase.deproxy(polytomousKeyNodeService.find(polytomousKeyNodeUuid2));
Assert.assertNotNull(childOfRootPKNode);
Assert.assertSame(childOfRootPKNode, cacher.getFromCache(childOfRootPKNode));
// |- question : KeyStatement
// |- statement : KeyStatement
- PolytomousKey pkey = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH2_INIT_STRATEGY),PolytomousKey.class);
+ PolytomousKey pkey = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH2_INIT_STRATEGY));
Assert.assertSame(childOfRootPKNode, cacher.getFromCache(childOfRootPKNode));
Assert.assertSame(pkey.getRoot().getChildAt(1), childOfRootPKNode);
// |- question : KeyStatement
// |- statement : KeyStatement
- PolytomousKey pkey = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH2_INIT_STRATEGY),PolytomousKey.class);
+ PolytomousKey pkey = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH2_INIT_STRATEGY));
// this call will load into the session cache a polytomous key node object
- PolytomousKeyNode rootPKNode = CdmBase.deproxy(polytomousKeyNodeService.find(polytomousKeyNodeUuid1),PolytomousKeyNode.class);
+ PolytomousKeyNode rootPKNode = CdmBase.deproxy(polytomousKeyNodeService.find(polytomousKeyNodeUuid1));
Assert.assertNotNull(rootPKNode);
Assert.assertSame(rootPKNode, cacher.getFromCache(rootPKNode));
- PolytomousKeyNode childOfRootPKNode = CdmBase.deproxy(polytomousKeyNodeService.find(polytomousKeyNodeUuid2),PolytomousKeyNode.class);
+ PolytomousKeyNode childOfRootPKNode = CdmBase.deproxy(polytomousKeyNodeService.find(polytomousKeyNodeUuid2));
Assert.assertNotNull(childOfRootPKNode);
Assert.assertSame(childOfRootPKNode, cacher.getFromCache(childOfRootPKNode));
// |- question : KeyStatement
// |- statement : KeyStatement
- PolytomousKey pkey = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH2_INIT_STRATEGY),PolytomousKey.class);
+ PolytomousKey pkey = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH2_INIT_STRATEGY));
PolytomousKeyNode childOfRootPKNode = pkey.getRoot().getChildAt(1);
// |- question : KeyStatement
// |- statement : KeyStatement
- PolytomousKey pkey = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH3_INIT_STRATEGY),PolytomousKey.class);
+ PolytomousKey pkey = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH3_INIT_STRATEGY));
Map<Language, LanguageString> labelMap = pkey.getRoot().getStatement().getLabel();