use of org.jboss.tools.hibernate.runtime.common.AbstractTableFacade in project jbosstools-hibernate by jbosstools.
the class TableFacadeTest method testIsPhysicalTable.
@Test
public void testIsPhysicalTable() {
Table table = new Table();
ITable tableFacade = new AbstractTableFacade(FACADE_FACTORY, table) {
};
table.setSubselect("foo");
assertFalse(tableFacade.isPhysicalTable());
table.setSubselect(null);
assertTrue(tableFacade.isPhysicalTable());
}
use of org.jboss.tools.hibernate.runtime.common.AbstractTableFacade in project jbosstools-hibernate by jbosstools.
the class TableFacadeTest method testAddColumn.
@Test
public void testAddColumn() {
Table table = new Table();
ITable tableFacade = new AbstractTableFacade(FACADE_FACTORY, table) {
};
Column column = new Column("foo");
IColumn columnFacade = FACADE_FACTORY.createColumn(column);
assertNull(table.getColumn(column));
tableFacade.addColumn(columnFacade);
assertSame(column, table.getColumn(column));
}
use of org.jboss.tools.hibernate.runtime.common.AbstractTableFacade in project jbosstools-hibernate by jbosstools.
the class TableFacadeTest method testGetCatalog.
@Test
public void testGetCatalog() {
Table table = new Table();
ITable tableFacade = new AbstractTableFacade(FACADE_FACTORY, table) {
};
assertNull(tableFacade.getCatalog());
table.setCatalog("foo");
assertEquals("foo", tableFacade.getCatalog());
}
use of org.jboss.tools.hibernate.runtime.common.AbstractTableFacade in project jbosstools-hibernate by jbosstools.
the class TableFacadeTest method testIsAbstractUnionTable.
@Test
public void testIsAbstractUnionTable() throws Exception {
Table table = new Table();
ITable tableFacade = new AbstractTableFacade(FACADE_FACTORY, table) {
};
table.setAbstract(false);
assertFalse(tableFacade.isAbstractUnionTable());
table.setAbstract(true);
assertFalse(tableFacade.isAbstractUnionTable());
Method method = Table.class.getDeclaredMethod("setHasDenormalizedTables", new Class[] {});
method.setAccessible(true);
method.invoke(table, new Object[] {});
assertTrue(tableFacade.isAbstractUnionTable());
}
Aggregations