Search in sources :

Example 31 with BasicValue

use of org.hibernate.mapping.BasicValue in project jbosstools-hibernate by jbosstools.

the class ValueFacadeTest method testIsPrimitiveArray.

@Test
public void testIsPrimitiveArray() {
    SimpleValue simpleValueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
    valueFacade = new AbstractValueFacade(FACADE_FACTORY, simpleValueTarget) {
    };
    assertFalse(valueFacade.isPrimitiveArray());
    PrimitiveArray primitiveArrayTarget = new PrimitiveArray(DummyMetadataBuildingContext.INSTANCE, null);
    valueFacade = new AbstractValueFacade(FACADE_FACTORY, primitiveArrayTarget) {
    };
    assertTrue(valueFacade.isPrimitiveArray());
}
Also used : AbstractValueFacade(org.jboss.tools.hibernate.runtime.common.AbstractValueFacade) PrimitiveArray(org.hibernate.mapping.PrimitiveArray) SimpleValue(org.hibernate.mapping.SimpleValue) BasicValue(org.hibernate.mapping.BasicValue) Test(org.junit.jupiter.api.Test)

Example 32 with BasicValue

use of org.hibernate.mapping.BasicValue in project jbosstools-hibernate by jbosstools.

the class ValueFacadeTest method testIsMap.

@Test
public void testIsMap() {
    valueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
    valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
    };
    assertFalse(valueFacade.isMap());
    Map map = new Map(DummyMetadataBuildingContext.INSTANCE, null);
    valueFacade = new AbstractValueFacade(FACADE_FACTORY, map) {
    };
    assertTrue(valueFacade.isMap());
}
Also used : AbstractValueFacade(org.jboss.tools.hibernate.runtime.common.AbstractValueFacade) Map(org.hibernate.mapping.Map) BasicValue(org.hibernate.mapping.BasicValue) Test(org.junit.jupiter.api.Test)

Example 33 with BasicValue

use of org.hibernate.mapping.BasicValue in project jbosstools-hibernate by jbosstools.

the class ValueFacadeTest method testAddColumn.

@Test
public void testAddColumn() {
    SimpleValue simpleValueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
    simpleValueTarget.setTable(new Table());
    valueFacade = new AbstractValueFacade(FACADE_FACTORY, simpleValueTarget) {
    };
    Iterator<?> columnIterator = simpleValueTarget.getColumnIterator();
    assertFalse(columnIterator.hasNext());
    Column columnTarget = new Column();
    IColumn columnFacade = FACADE_FACTORY.createColumn(columnTarget);
    valueFacade.addColumn(columnFacade);
    columnIterator = simpleValueTarget.getColumnIterator();
    assertTrue(columnIterator.hasNext());
    assertSame(columnTarget, columnIterator.next());
}
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) Column(org.hibernate.mapping.Column) IColumn(org.jboss.tools.hibernate.runtime.spi.IColumn) SimpleValue(org.hibernate.mapping.SimpleValue) BasicValue(org.hibernate.mapping.BasicValue) Test(org.junit.jupiter.api.Test)

Example 34 with BasicValue

use of org.hibernate.mapping.BasicValue in project jbosstools-hibernate by jbosstools.

the class ValueFacadeTest method testIsSimpleValue.

@Test
public void testIsSimpleValue() {
    valueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
    valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
    };
    assertTrue(valueFacade.isSimpleValue());
    valueTarget = new Set(DummyMetadataBuildingContext.INSTANCE, null);
    valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
    };
    assertFalse(valueFacade.isSimpleValue());
}
Also used : AbstractValueFacade(org.jboss.tools.hibernate.runtime.common.AbstractValueFacade) Set(org.hibernate.mapping.Set) BasicValue(org.hibernate.mapping.BasicValue) Test(org.junit.jupiter.api.Test)

Example 35 with BasicValue

use of org.hibernate.mapping.BasicValue in project jbosstools-hibernate by jbosstools.

the class ValueFacadeTest method testSetTable.

@Test
public void testSetTable() {
    Table tableTarget = new Table();
    ITable tableFacade = FACADE_FACTORY.createTable(tableTarget);
    SimpleValue valueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
    valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
    };
    assertNull(valueTarget.getTable());
    valueFacade.setTable(tableFacade);
    assertSame(tableTarget, valueTarget.getTable());
}
Also used : ITable(org.jboss.tools.hibernate.runtime.spi.ITable) Table(org.hibernate.mapping.Table) AbstractValueFacade(org.jboss.tools.hibernate.runtime.common.AbstractValueFacade) ITable(org.jboss.tools.hibernate.runtime.spi.ITable) 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