assert isValidKey(key) : "Keys only consist of word characters"; //$NON-NLS-1$ assert registeredValues.containsKey(key) || registeredValuesOverride.containsKey(key) : "Couldn't find SQLString key: " + key + ", dbtype " + dbType; //$NON-NLS-1$ //$NON-NLS-2$
/** * A Factory used by the SQL class to turn a string sql query into an SQLString object. * This may just contain the sql given, or the given SQL may be overriden in the database and the object returned * will reflect that new SQL from the DB. * * @param sql The string to be used in a query * @return a SQLString object representing the given SQL */ @SuppressWarnings("GuardedByChecker") static FinalSQLString getUnregisteredQuery(String sql) { assert !isValidKey(sql) : "Unregistered Queries should not look like keys"; //$NON-NLS-1$ FinalSQLString cached = cachedUnregistered.get(canonicalizeStringAndRemoveWhitespaceEntirely(sql)); if (null != cached) { callbackOnUse.noteUse((SQLString) cached.delegate); return cached; } return new FinalSQLString(new SQLString(sql)); }
assert isValidKey(key) : "Keys only consist of word characters"; //$NON-NLS-1$ assert registeredValues.containsKey(key) || registeredValuesOverride.containsKey(key) : "Couldn't find SQLString key: " + key + ", dbtype " + dbType; //$NON-NLS-1$ //$NON-NLS-2$
/** * A Factory used by the SQL class to turn a string sql query into an SQLString object. * This may just contain the sql given, or the given SQL may be overriden in the database and the object returned * will reflect that new SQL from the DB. * * @param sql The string to be used in a query * @return a SQLString object representing the given SQL */ @SuppressWarnings("GuardedByChecker") static FinalSQLString getUnregisteredQuery(String sql) { assert !isValidKey(sql) : "Unregistered Queries should not look like keys"; //$NON-NLS-1$ FinalSQLString cached = cachedUnregistered.get(canonicalizeStringAndRemoveWhitespaceEntirely(sql)); if (null != cached) { callbackOnUse.noteUse((SQLString) cached.delegate); return cached; } return new FinalSQLString(new SQLString(sql)); }