use of org.hibernate.mapping.KeyValue in project jbosstools-hibernate by jbosstools.
the class TableFacadeTest method testGetIdentifierValue.
@Test
public void testGetIdentifierValue() {
Table table = new Table();
ITable tableFacade = FACADE_FACTORY.createTable(table);
IValue valueFacade = tableFacade.getIdentifierValue();
assertNull(valueFacade);
KeyValue value = new SimpleValue(DummyMetadataBuildingContext.INSTANCE, null);
table.setIdentifierValue(value);
valueFacade = tableFacade.getIdentifierValue();
assertSame(value, ((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(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 ValueFacadeTest method testSetKey.
@Test
public void testSetKey() {
KeyValue keyValueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
IValue keyValueFacade = new AbstractValueFacade(FACADE_FACTORY, keyValueTarget) {
};
Collection collectionTarget = new Bag(DummyMetadataBuildingContext.INSTANCE, null);
IValue collectionFacade = new AbstractValueFacade(FACADE_FACTORY, collectionTarget) {
};
assertNull(collectionTarget.getKey());
collectionFacade.setKey(keyValueFacade);
assertSame(keyValueTarget, collectionTarget.getKey());
}
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 = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
};
assertNull(valueFacade.getKey());
KeyValue keyValue = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
valueTarget.setKey(keyValue);
assertSame(keyValue, ((IFacade) valueFacade.getKey()).getTarget());
}
use of org.hibernate.mapping.KeyValue in project jbosstools-hibernate by jbosstools.
the class TableFacadeTest method testGetIdentifierValue.
@Test
public void testGetIdentifierValue() {
Table table = new Table();
ITable tableFacade = FACADE_FACTORY.createTable(table);
IValue valueFacade = tableFacade.getIdentifierValue();
assertNull(valueFacade);
KeyValue value = new SimpleValue(null);
table.setIdentifierValue(value);
valueFacade = tableFacade.getIdentifierValue();
assertSame(value, ((IFacade) valueFacade).getTarget());
}
Aggregations