/** {@inheritDoc} */ @Override public String identitySelect(String identitySelectName, String tableName, String columnName) { String identitySelect = (SqlIdentityPlugin.MODIFIER_IDENTITY_SELECT.equals(identitySelectName)) ? null : SqlProcessContext.getFeature(identitySelectName); if (identitySelect != null) return identitySelect; return SqlProcessContext.getFeature(SqlFeature.IDSEL); }
/** {@inheritDoc} */ @Override public String sequenceSelect(String sequenceName) { String sequence = SqlProcessContext.getFeature(sequenceName); if (sequence != null) return sequence; String sequencePattern = SqlProcessContext.getFeature(SqlFeature.SEQ); if (sequencePattern == null) return null; int ix = sequencePattern.indexOf("$n"); if (ix < 0) return sequencePattern; if (SqlSequencePlugin.MODIFIER_SEQUENCE.equals(sequenceName)) return sequencePattern.substring(0, ix) + SqlFeature.DEFAULT_SEQ_NAME + sequencePattern.substring(ix + 2); else return sequencePattern.substring(0, ix) + sequenceName + sequencePattern.substring(ix + 2); }
/** {@inheritDoc} */ @Override public LimitType limitQuery( String queryString, StringBuilder queryResult, Integer firstResult, Integer maxResults, boolean ordered) { LimitType limitType = new LimitType(); if (maxResults == null || maxResults <= 0) return null; if (firstResult != null && firstResult > 0) { limitType.alsoFirst = true; String limitPattern = (ordered) ? SqlProcessContext.getFeature(SqlFeature.LIMIT_FROM_TO_ORDERED) : SqlProcessContext.getFeature(SqlFeature.LIMIT_FROM_TO); if (limitPattern == null && ordered) limitPattern = SqlProcessContext.getFeature(SqlFeature.LIMIT_FROM_TO); limitType = limitQuery(limitPattern, limitType, queryString, queryResult, firstResult, maxResults); return limitType; } else { String limitPattern = (ordered) ? SqlProcessContext.getFeature(SqlFeature.LIMIT_TO_ORDERED) : SqlProcessContext.getFeature(SqlFeature.LIMIT_TO); if (limitPattern == null && ordered) limitPattern = SqlProcessContext.getFeature(SqlFeature.LIMIT_TO); limitType = limitQuery(limitPattern, limitType, queryString, queryResult, firstResult, maxResults); return limitType; } }