use of com.querydsl.sql.MySQLTemplates in project querydsl by querydsl.
the class NativeSQLSerializerTest method path_column2.
@Test
public void path_column2() {
PathBuilder<Entity> entity = new PathBuilder<Entity>(Entity.class, "entity");
Configuration conf = new Configuration(new MySQLTemplates());
NativeSQLSerializer serializer = new NativeSQLSerializer(conf, true);
serializer.handle(entity.get("firstName"));
assertEquals("entity.first_name", serializer.toString());
}
use of com.querydsl.sql.MySQLTemplates in project querydsl by querydsl.
the class NativeSQLSerializerTest method in.
@Test
public void in() {
Configuration conf = new Configuration(new MySQLTemplates());
NativeSQLSerializer serializer = new NativeSQLSerializer(conf, true);
DefaultQueryMetadata md = new DefaultQueryMetadata();
SAnimal cat = SAnimal.animal_;
md.addJoin(JoinType.DEFAULT, cat);
md.addWhere(cat.name.in("X", "Y"));
md.setProjection(cat.id);
serializer.serialize(md, false);
assertEquals("select animal_.id\n" + "from animal_ animal_\n" + "where animal_.name in (?1, ?2)", serializer.toString());
}
use of com.querydsl.sql.MySQLTemplates in project querydsl by querydsl.
the class NativeSQLSerializerTest method path_column.
@Test
public void path_column() {
PathBuilder<Entity> entity = new PathBuilder<Entity>(Entity.class, "entity");
Configuration conf = new Configuration(new MySQLTemplates());
NativeSQLSerializer serializer = new NativeSQLSerializer(conf, true);
serializer.handle(entity.get("name"));
assertEquals("entity.name", serializer.toString());
}
Aggregations