use of org.hibernate.mapping.BasicValue in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testGetTypeParameters.
@Test
public void testGetTypeParameters() {
SimpleValue simpleValueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, simpleValueTarget) {
};
assertNull(simpleValueTarget.getTypeParameters());
Properties properties = new Properties();
valueFacade.setTypeParameters(properties);
assertSame(properties, simpleValueTarget.getTypeParameters());
}
use of org.hibernate.mapping.BasicValue in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testGetColumnIterator.
@Test
public void testGetColumnIterator() {
SimpleValue valueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
valueTarget.setTable(new Table());
valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
};
Iterator<IColumn> columnIterator = valueFacade.getColumnIterator();
assertFalse(columnIterator.hasNext());
Column columnTarget = new Column();
valueTarget.addColumn(columnTarget);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
};
columnIterator = valueFacade.getColumnIterator();
assertTrue(columnIterator.hasNext());
assertSame(columnTarget, ((IFacade) columnIterator.next()).getTarget());
}
use of org.hibernate.mapping.BasicValue in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testIsEmbedded.
@Test
public void testIsEmbedded() {
valueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
};
assertNull(valueFacade.isEmbedded());
Component component = new Component(DummyMetadataBuildingContext.INSTANCE, new RootClass(DummyMetadataBuildingContext.INSTANCE));
valueFacade = new AbstractValueFacade(FACADE_FACTORY, component) {
};
component.setEmbedded(true);
assertTrue(valueFacade.isEmbedded());
component.setEmbedded(false);
assertFalse(valueFacade.isEmbedded());
}
use of org.hibernate.mapping.BasicValue in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testIsToOne.
@Test
public void testIsToOne() {
valueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
};
assertFalse(valueFacade.isToOne());
ToOne toOne = new OneToOne(DummyMetadataBuildingContext.INSTANCE, null, new RootClass(DummyMetadataBuildingContext.INSTANCE));
valueFacade = new AbstractValueFacade(FACADE_FACTORY, toOne) {
};
assertTrue(valueFacade.isToOne());
}
use of org.hibernate.mapping.BasicValue in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testIsDependantValue.
@Test
public void testIsDependantValue() {
SimpleValue simpleValueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, simpleValueTarget) {
};
assertFalse(valueFacade.isDependantValue());
DependantValue dependantValueTarget = new DependantValue(DummyMetadataBuildingContext.INSTANCE, null, null);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, dependantValueTarget) {
};
assertTrue(valueFacade.isDependantValue());
}
Aggregations