dbOom.registerType(BadBoy.class);
}
@Test
public void testTable() {
DbSqlBuilder s;
// [1]
s = sql().table("Boy");
assertEquals("BOY", s.generateQuery());
assertNotNull(s.getTableDescriptor("Boy"));
s = sql().table("Boy", null);
assertEquals("BOY", s.generateQuery());
assertNotNull(s.getTableDescriptor("Boy"));
s = sql().table("Boy", "bbb");
assertEquals("BOY bbb", s.generateQuery());
assertNotNull(s.getTableDescriptor("bbb"));
// [2]
s = sql().table("BadBoy");
assertEquals("BOY", s.generateQuery());
assertNotNull(s.getTableDescriptor("BadBoy"));
s = sql().table("BadBoy", null);
assertEquals("BOY", s.generateQuery());
assertNotNull(s.getTableDescriptor("BadBoy"));
s = sql().table("BadBoy", "bbb");
assertEquals("BOY bbb", s.generateQuery());
assertNotNull(s.getTableDescriptor("bbb"));
// [3]
s = sql().table(Boy.class);
assertEquals("BOY Boy", s.generateQuery());
assertNotNull(s.getTableDescriptor("Boy"));
s = sql().table(Boy.class, null);
assertEquals("BOY", s.generateQuery());
assertNotNull(s.getTableDescriptor("Boy"));
s = sql().table(Boy.class, "bbb");
assertEquals("BOY bbb", s.generateQuery());
assertNotNull(s.getTableDescriptor("bbb"));
// [4]
s = sql().table(BadBoy.class);
assertEquals("BOY BadBoy", s.generateQuery());
assertNotNull(s.getTableDescriptor("BadBoy"));
s = sql().table(BadBoy.class, null);
assertEquals("BOY", s.generateQuery());
assertNotNull(s.getTableDescriptor("BadBoy"));
s = sql().table(BadBoy.class, "bbb");
assertEquals("BOY bbb", s.generateQuery());
assertNotNull(s.getTableDescriptor("bbb"));
// [5]
s = sql().table("bbb").use("bbb", Boy.class);
assertEquals("BOY", s.generateQuery());
assertNotNull(s.getTableDescriptor("bbb"));
s = sql().table("bbb", null).use("bbb", Boy.class);
assertEquals("BOY", s.generateQuery());
assertNotNull(s.getTableDescriptor("bbb"));
s = sql().table("bbb", "x").use("bbb", Boy.class);
assertEquals("BOY x", s.generateQuery());
assertNotNull(s.getTableDescriptor("x"));
// [6]
s = sql().table("Boy bbb");
assertEquals("BOY bbb", s.generateQuery());
assertNotNull(s.getTableDescriptor("bbb"));
s = sql().table("BadBoy bbb");
assertEquals("BOY bbb", s.generateQuery());
assertNotNull(s.getTableDescriptor("bbb"));
}