use of com.querydsl.sql.Configuration in project querydsl by querydsl.
the class SQLCodegenModule method configure.
@Override
protected void configure() {
super.configure();
bind(NamingStrategy.class, DefaultNamingStrategy.class);
bind(Configuration.class, new Configuration(SQLTemplates.DEFAULT));
bind(Serializer.class, MetaDataSerializer.class);
bind(QueryTypeFactory.class, SQLQueryTypeFactory.class);
bind(BEAN_SERIALIZER, (Class<?>) null);
bind(INNER_CLASSES_FOR_KEYS, false);
bind(BEAN_PREFIX, "");
bind(BEAN_SUFFIX, "");
bind(BEAN_PACKAGE_NAME, "com.example");
bind(PACKAGE_NAME, "com.example");
bind(BEAN_SERIALIZER, (Class<?>) null);
bind(SCHEMA_TO_PACKAGE, false);
bindInstance(ENTITYPATH_TYPE, RelationalPathBase.class);
bind(COLUMN_COMPARATOR, null);
}
use of com.querydsl.sql.Configuration 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.Configuration 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