Search in sources :

Example 21 with DbSqlBuilder

use of jodd.db.oom.sqlgen.DbSqlBuilder in project jodd by oblac.

the class DbSqlTemplateWithPrefixTest method testTablePrefixSuffix.

@Test
public void testTablePrefixSuffix() {
    DbSqlBuilder st;
    st = sql("$T{Boy} $Boy.id $C{Boy.id}");
    assertEquals("PRE_BOY_SUF PRE_BOY_SUF.ID PRE_BOY_SUF.ID", st.generateQuery());
    st = sql("$T{Boy b} $b.id $C{b.id}");
    assertEquals("PRE_BOY_SUF b b.ID b.ID", st.generateQuery());
}
Also used : DbSqlBuilder(jodd.db.oom.sqlgen.DbSqlBuilder) Test(org.junit.Test)

Aggregations

DbSqlBuilder (jodd.db.oom.sqlgen.DbSqlBuilder)21 Test (org.junit.Test)20 BadBoy (jodd.db.oom.tst.BadBoy)10 Boy (jodd.db.oom.tst.Boy)9 List (java.util.List)2 DbSession (jodd.db.DbSession)2 DbThreadSession (jodd.db.DbThreadSession)2 ParameterValue (jodd.db.oom.sqlgen.ParameterValue)2 BadGirl (jodd.db.oom.tst.BadGirl)2 Girl (jodd.db.oom.tst.Girl)2 ResultSet (java.sql.ResultSet)1 ArrayList (java.util.ArrayList)1 Iterator (java.util.Iterator)1 Set (java.util.Set)1 DbQuery (jodd.db.DbQuery)1 QueryMapper (jodd.db.QueryMapper)1 DbOomQuery (jodd.db.oom.DbOomQuery)1