Search in sources :

Example 11 with BasicValue

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());
}
Also used : AbstractValueFacade(org.jboss.tools.hibernate.runtime.common.AbstractValueFacade) Properties(java.util.Properties) SimpleValue(org.hibernate.mapping.SimpleValue) BasicValue(org.hibernate.mapping.BasicValue) Test(org.junit.jupiter.api.Test)

Example 12 with BasicValue

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());
}
Also used : ITable(org.jboss.tools.hibernate.runtime.spi.ITable) Table(org.hibernate.mapping.Table) AbstractValueFacade(org.jboss.tools.hibernate.runtime.common.AbstractValueFacade) IColumn(org.jboss.tools.hibernate.runtime.spi.IColumn) IColumn(org.jboss.tools.hibernate.runtime.spi.IColumn) Column(org.hibernate.mapping.Column) SimpleValue(org.hibernate.mapping.SimpleValue) BasicValue(org.hibernate.mapping.BasicValue) Test(org.junit.jupiter.api.Test)

Example 13 with BasicValue

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());
}
Also used : RootClass(org.hibernate.mapping.RootClass) AbstractValueFacade(org.jboss.tools.hibernate.runtime.common.AbstractValueFacade) Component(org.hibernate.mapping.Component) BasicValue(org.hibernate.mapping.BasicValue) Test(org.junit.jupiter.api.Test)

Example 14 with BasicValue

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());
}
Also used : RootClass(org.hibernate.mapping.RootClass) OneToOne(org.hibernate.mapping.OneToOne) AbstractValueFacade(org.jboss.tools.hibernate.runtime.common.AbstractValueFacade) ToOne(org.hibernate.mapping.ToOne) ManyToOne(org.hibernate.mapping.ManyToOne) OneToOne(org.hibernate.mapping.OneToOne) BasicValue(org.hibernate.mapping.BasicValue) Test(org.junit.jupiter.api.Test)

Example 15 with BasicValue

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());
}
Also used : AbstractValueFacade(org.jboss.tools.hibernate.runtime.common.AbstractValueFacade) DependantValue(org.hibernate.mapping.DependantValue) SimpleValue(org.hibernate.mapping.SimpleValue) BasicValue(org.hibernate.mapping.BasicValue) Test(org.junit.jupiter.api.Test)

Aggregations

BasicValue (org.hibernate.mapping.BasicValue)40 Test (org.junit.jupiter.api.Test)39 AbstractValueFacade (org.jboss.tools.hibernate.runtime.common.AbstractValueFacade)36 SimpleValue (org.hibernate.mapping.SimpleValue)22 RootClass (org.hibernate.mapping.RootClass)7 Table (org.hibernate.mapping.Table)6 IValue (org.jboss.tools.hibernate.runtime.spi.IValue)6 IdentifierBag (org.hibernate.mapping.IdentifierBag)5 Set (org.hibernate.mapping.Set)5 ITable (org.jboss.tools.hibernate.runtime.spi.ITable)5 Bag (org.hibernate.mapping.Bag)4 Column (org.hibernate.mapping.Column)3 KeyValue (org.hibernate.mapping.KeyValue)3 List (org.hibernate.mapping.List)3 ManyToOne (org.hibernate.mapping.ManyToOne)3 OneToOne (org.hibernate.mapping.OneToOne)3 Collection (org.hibernate.mapping.Collection)2 Component (org.hibernate.mapping.Component)2 Map (org.hibernate.mapping.Map)2 PrimitiveArray (org.hibernate.mapping.PrimitiveArray)2