use of com.querydsl.core.QueryFlag in project querydsl by querydsl.
the class SQLServer2005Templates method serializeDelete.
@Override
public void serializeDelete(QueryMetadata metadata, RelationalPath<?> entity, SQLSerializer context) {
// limit
QueryModifiers mod = metadata.getModifiers();
if (mod.isRestricting()) {
metadata = metadata.clone();
metadata.addFlag(new QueryFlag(QueryFlag.Position.AFTER_SELECT, Expressions.template(Integer.class, topTemplate, mod.getLimit())));
}
context.serializeForDelete(metadata, entity);
if (!metadata.getFlags().isEmpty()) {
context.serialize(Position.END, metadata.getFlags());
}
}
use of com.querydsl.core.QueryFlag in project querydsl by querydsl.
the class OracleTemplatesTest method modifiers2.
@Test
public void modifiers2() {
query.from(survey1).limit(5).offset(3);
query.getMetadata().setProjection(survey1.id);
query.getMetadata().addFlag(new QueryFlag(QueryFlag.Position.AFTER_PROJECTION, ", count(*) over() "));
assertEquals("select * from ( " + "select a.*, rownum rn from ( " + "select survey1.ID, count(*) over() from SURVEY survey1 ) " + "a) " + "where rn > 3 and rownum <= 5", query.toString());
}
Aggregations