use of org.jboss.tools.hibernate.runtime.spi.ITable in project jbosstools-hibernate by jbosstools.
the class TableFacadeTest method testGetPrimaryKey.
@Test
public void testGetPrimaryKey() {
Table table = new Table();
PrimaryKey primaryKey = new PrimaryKey(table);
ITable tableFacade = FACADE_FACTORY.createTable(table);
Assert.assertNull(tableFacade.getPrimaryKey());
table.setPrimaryKey(primaryKey);
IPrimaryKey primaryKeyFacade = tableFacade.getPrimaryKey();
Assert.assertSame(primaryKey, ((IFacade) primaryKeyFacade).getTarget());
}
use of org.jboss.tools.hibernate.runtime.spi.ITable in project jbosstools-hibernate by jbosstools.
the class TableFacadeTest method testIsAbstract.
@Test
public void testIsAbstract() {
Table table = new Table();
ITable tableFacade = FACADE_FACTORY.createTable(table);
table.setAbstract(true);
Assert.assertTrue(tableFacade.isAbstract());
table.setAbstract(false);
Assert.assertFalse(tableFacade.isAbstract());
}
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 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 testGetSchema.
@Test
public void testGetSchema() {
Table table = new Table();
ITable tableFacade = FACADE_FACTORY.createTable(table);
Assert.assertNull(tableFacade.getSchema());
table.setSchema("foo");
Assert.assertEquals("foo", tableFacade.getSchema());
}
Aggregations