use of org.hibernate.mapping.BasicValue 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.BasicValue in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testIsArray.
@Test
public void testIsArray() {
SimpleValue simpleValueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, simpleValueTarget) {
};
assertFalse(valueFacade.isArray());
Array arrayTarget = new Array(DummyMetadataBuildingContext.INSTANCE, null);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, arrayTarget) {
};
assertTrue(valueFacade.isArray());
}
use of org.hibernate.mapping.BasicValue 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.BasicValue in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testIsIdentifierBag.
@Test
public void testIsIdentifierBag() {
SimpleValue simpleValueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, simpleValueTarget) {
};
assertFalse(valueFacade.isIdentifierBag());
IdentifierBag identifierBagTarget = new IdentifierBag(DummyMetadataBuildingContext.INSTANCE, null);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, identifierBagTarget) {
};
assertTrue(valueFacade.isIdentifierBag());
}
use of org.hibernate.mapping.BasicValue in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testGetForeignKeyName.
@Test
public void testGetForeignKeyName() {
SimpleValue simpleValueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, simpleValueTarget) {
};
assertNull(valueFacade.getForeignKeyName());
simpleValueTarget.setForeignKeyName("foobar");
assertEquals("foobar", valueFacade.getForeignKeyName());
}
Aggregations