/** * Creates a query string for a limit query, but does not set the varbinds. * To use this, you will have to pass your varbinds through a limitQuery call. * query with a limitQuery call. This decoupling of the query creating and the varbinds * allows for the registration of limit queries. * <p> * This method has NoOffset in the name because it creates a limit query that * does not have an offset value. The presence of an offset could change the * resulting String. * * @see addVarbindsForLimitQuery */ public static String formatLimitQuery(String query, BasicSQL.OffsetInclusion offset, DBType dbType) { int fakeOffset; if (offset.equals(BasicSQL.OffsetInclusion.INCLUDE_OFFSET)) { //TODO (dcohen): comment why this fake offset causes the proper query to be created fakeOffset = 1; } else { fakeOffset = 0; } return internalLimitQuery(query, 1, fakeOffset, new ArrayList<Object>(), dbType); }
/** * Creates a query string for a limit query, but does not set the varbinds. * To use this, you will have to pass your varbinds through a limitQuery call. * query with a limitQuery call. This decoupling of the query creating and the varbinds * allows for the registration of limit queries. * <p> * This method has NoOffset in the name because it creates a limit query that * does not have an offset value. The presence of an offset could change the * resulting String. * * @see addVarbindsForLimitQuery */ public static String formatLimitQuery(String query, BasicSQL.OffsetInclusion offset, DBType dbType) { int fakeOffset; if (offset.equals(BasicSQL.OffsetInclusion.INCLUDE_OFFSET)) { //TODO (dcohen): comment why this fake offset causes the proper query to be created fakeOffset = 1; } else { fakeOffset = 0; } return internalLimitQuery(query, 1, fakeOffset, new ArrayList<Object>(), dbType); }