public SqlStatementCustomizer createForType(Annotation annotation, Class sqlObjectType) { final int va = ((MaxRows)annotation).value(); return new SqlStatementCustomizer() { public void apply(SQLStatement q) throws SQLException { assert q instanceof Query; ((Query)q).setMaxRows(va); } }; }
@SqlQuery("select id, name from something") @MaxRows(1) public List<Something> findAllWithMaxRows();
@SqlQuery("select id, name from something") public List<Something> findAllWithMaxRows(@MaxRows(1) int fetchSize);
public SqlStatementCustomizer createForMethod(Annotation annotation, Class sqlObjectType, Method method) { final int va = ((MaxRows)annotation).value(); return new SqlStatementCustomizer() { public void apply(SQLStatement q) throws SQLException { assert q instanceof Query; ((Query)q).setMaxRows(va); } }; }
@SqlQuery("select id, name from something") @MaxRows(1) public List<Something> findAllWithMaxRows();
@Override public SqlStatementCustomizer createForType(Annotation annotation, Class sqlObjectType) { final int va = ((MaxRows)annotation).value(); return new SqlStatementCustomizer() { @Override public void apply(SQLStatement q) throws SQLException { assert q instanceof Query; ((Query)q).setMaxRows(va); } }; }
@SqlQuery("select id, name from something") public List<Something> findAllWithMaxRows(@MaxRows(1) int fetchSize);
@Override public SqlStatementCustomizer createForMethod(Annotation annotation, Class sqlObjectType, Method method) { final int va = ((MaxRows)annotation).value(); return new SqlStatementCustomizer() { @Override public void apply(SQLStatement q) throws SQLException { assert q instanceof Query; ((Query)q).setMaxRows(va); } }; }