use of org.jboss.tools.hibernate.runtime.spi.ITable in project jbosstools-hibernate by jbosstools.
the class TableFacadeTest method testAddColumn.
@Test
public void testAddColumn() {
Table table = new Table();
ITable tableFacade = FACADE_FACTORY.createTable(table);
Column column = new Column("foo");
IColumn columnFacade = FACADE_FACTORY.createColumn(column);
Assert.assertNull(table.getColumn(column));
tableFacade.addColumn(columnFacade);
Assert.assertSame(column, table.getColumn(column));
}
use of org.jboss.tools.hibernate.runtime.spi.ITable in project jbosstools-hibernate by jbosstools.
the class TableFacadeTest method testIsPhysicalTable.
@Test
public void testIsPhysicalTable() {
Table table = new Table();
ITable tableFacade = FACADE_FACTORY.createTable(table);
table.setSubselect("foo");
Assert.assertFalse(tableFacade.isPhysicalTable());
table.setSubselect(null);
Assert.assertTrue(tableFacade.isPhysicalTable());
}
use of org.jboss.tools.hibernate.runtime.spi.ITable in project jbosstools-hibernate by jbosstools.
the class TableFacadeTest method testGetName.
@Test
public void testGetName() {
Table table = new Table();
ITable tableFacade = FACADE_FACTORY.createTable(table);
Assert.assertNull(tableFacade.getName());
table.setName("foo");
Assert.assertEquals("foo", tableFacade.getName());
}
use of org.jboss.tools.hibernate.runtime.spi.ITable in project jbosstools-hibernate by jbosstools.
the class TableFacadeTest method testGetSubselect.
@Test
public void testGetSubselect() {
Table table = new Table();
ITable tableFacade = FACADE_FACTORY.createTable(table);
Assert.assertNull(tableFacade.getSubselect());
table.setSubselect("foo");
Assert.assertEquals("foo", tableFacade.getSubselect());
}
use of org.jboss.tools.hibernate.runtime.spi.ITable 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();
Assert.assertNull(valueFacade);
KeyValue value = new SimpleValue(null);
table.setIdentifierValue(value);
valueFacade = tableFacade.getIdentifierValue();
Assert.assertSame(value, ((IFacade) valueFacade).getTarget());
}
Aggregations