use of org.hibernate.mapping.KeyValue in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testGetKey.
@Test
public void testGetKey() {
Map valueTarget = new Map(DummyMetadataBuildingContext.INSTANCE, null);
valueFacade = FACADE_FACTORY.createValue(valueTarget);
assertNull(valueFacade.getKey());
KeyValue keyValue = new SimpleValue(DummyMetadataBuildingContext.INSTANCE, null);
valueTarget.setKey(keyValue);
assertSame(keyValue, ((IFacade) valueFacade.getKey()).getTarget());
}
use of org.hibernate.mapping.KeyValue in project jbosstools-hibernate by jbosstools.
the class PersistentClassFacadeTest method testGetIdentifier.
@Test
public void testGetIdentifier() throws Exception {
KeyValue valueTarget = createValue();
Field field = AbstractPersistentClassFacade.class.getDeclaredField("identifier");
field.setAccessible(true);
assertNull(field.get(persistentClassFacade));
assertNull(persistentClassFacade.getIdentifier());
assertNull(field.get(persistentClassFacade));
((RootClass) persistentClassTarget).setIdentifier(valueTarget);
IValue valueFacade = persistentClassFacade.getIdentifier();
assertNotNull(valueFacade);
assertSame(valueFacade, field.get(persistentClassFacade));
assertSame(valueTarget, ((IFacade) valueFacade).getTarget());
}
use of org.hibernate.mapping.KeyValue in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testGetKey.
@Test
public void testGetKey() {
Map valueTarget = new Map(null, null);
valueFacade = FACADE_FACTORY.createValue(valueTarget);
assertNull(valueFacade.getKey());
KeyValue keyValue = new SimpleValue(null);
valueTarget.setKey(keyValue);
assertSame(keyValue, ((IFacade) valueFacade.getKey()).getTarget());
}
use of org.hibernate.mapping.KeyValue in project jbosstools-hibernate by jbosstools.
the class PersistentClassFacadeTest method testGetIdentifier.
@Test
public void testGetIdentifier() throws Exception {
KeyValue valueTarget = createValue();
Field field = AbstractPersistentClassFacade.class.getDeclaredField("identifier");
field.setAccessible(true);
assertNull(field.get(persistentClassFacade));
assertNull(persistentClassFacade.getIdentifier());
assertNull(field.get(persistentClassFacade));
((RootClass) persistentClassTarget).setIdentifier(valueTarget);
IValue valueFacade = persistentClassFacade.getIdentifier();
assertNotNull(valueFacade);
assertSame(valueFacade, field.get(persistentClassFacade));
assertSame(valueTarget, ((IFacade) valueFacade).getTarget());
}
use of org.hibernate.mapping.KeyValue in project jbosstools-hibernate by jbosstools.
the class PersistentClassFacadeTest method testGetIdentifier.
@Test
public void testGetIdentifier() throws Exception {
KeyValue valueTarget = createValue();
Field field = AbstractPersistentClassFacade.class.getDeclaredField("identifier");
field.setAccessible(true);
assertNull(field.get(persistentClassFacade));
assertNull(persistentClassFacade.getIdentifier());
assertNull(field.get(persistentClassFacade));
((RootClass) persistentClassTarget).setIdentifier(valueTarget);
IValue valueFacade = persistentClassFacade.getIdentifier();
assertNotNull(valueFacade);
assertSame(valueFacade, field.get(persistentClassFacade));
assertSame(valueTarget, ((IFacade) valueFacade).getTarget());
}
Aggregations