public void setCustomWrite(String customWrite) { this.customWrite = safeInterning( customWrite ); }
public EntityReferenceAliasesImpl(String tableAlias, EntityAliases columnAliases) { this.tableAlias = safeInterning( tableAlias ); this.columnAliases = columnAliases; }
/** * returns quoted name as it would be in the mapping file. */ public String getQuotedName() { return safeInterning( quoted ? "`" + name + "`" : name ); }
private void registerSqlTableAliasMapping(String querySpaceUid, String sqlTableAlias) { if ( querySpaceUidToSqlTableAliasMap == null ) { querySpaceUidToSqlTableAliasMap = new HashMap<String, String>(); } String old = querySpaceUidToSqlTableAliasMap.put( safeInterning( querySpaceUid ), safeInterning( sqlTableAlias ) ); if ( old != null ) { if ( old.equals( sqlTableAlias ) ) { // silently ignore... } else { throw new IllegalStateException( String.format( "Attempt to register multiple SQL table aliases [%s, %s, etc] against query space uid [%s]", old, sqlTableAlias, querySpaceUid ) ); } } }
public void setCustomRead(String customRead) { this.customRead = safeInterning( StringHelper.nullIfEmpty( customRead ) ); }
@Override public String getTemplate(Dialect dialect, SQLFunctionRegistry functionRegistry) { String template = Template.renderWhereStringTemplate(formula, dialect, functionRegistry); return safeInterning( StringHelper.replace( template, "{alias}", Template.TEMPLATE ) ); }
public String getQuotedName(Dialect d) { return safeInterning( quoted ? d.openQuote() + name + d.closeQuote() : name ); }
/** * Generate a column alias that is unique across multiple tables */ @Override public String getAlias(Dialect dialect, Table table) { return safeInterning( getAlias( dialect ) + table.getUniqueInteger() + '_' ); }
@Override public String getTemplate(Dialect dialect, SQLFunctionRegistry functionRegistry) { return safeInterning( hasCustomRead() // see note in renderTransformerReadFragment wrt access to SessionFactory ? Template.renderTransformerReadFragment( customRead, getQuotedName( dialect ) ) : Template.TEMPLATE + '.' + getQuotedName( dialect ) ); }
for ( final FilterConfiguration filter : filters ) { filterAutoAliasFlags[filterCount] = false; filterNames[filterCount] = safeInterning( filter.getName() ); filterConditions[filterCount] = safeInterning( filter.getCondition() ); filterAliasTableMaps[filterCount] = filter.getAliasTableMap( factory ); if ( ( filterAliasTableMaps[filterCount].isEmpty() || isTableFromPersistentClass( filterAliasTableMaps[filterCount] ) ) && filter .useAutoAliasInjection() ) { filterConditions[filterCount] = safeInterning( Template.renderWhereStringTemplate( filter.getCondition(), filterAutoAliasFlags[filterCount] = true; filterConditions[filterCount] = safeInterning( StringHelper.replace( filterConditions[filterCount],
public void setCustomWrite(String customWrite) { this.customWrite = safeInterning( customWrite ); }
public void setCustomRead(String customRead) { this.customRead = safeInterning( StringHelper.nullIfEmpty( customRead ) ); }
@Override public String getTemplate(Dialect dialect, SqmFunctionRegistry functionRegistry) { String template = Template.renderWhereStringTemplate(formula, dialect, functionRegistry); return safeInterning( StringHelper.replace( template, "{alias}", Template.TEMPLATE ) ); }
public String render() { return safeInterning( isQuoted ? '`' + getText() + '`' : getText() ); }
for ( final FilterConfiguration filter : filters ) { filterAutoAliasFlags[filterCount] = false; filterNames[filterCount] = safeInterning( filter.getName() ); filterConditions[filterCount] = safeInterning( filter.getCondition() ); filterAliasTableMaps[filterCount] = filter.getAliasTableMap( factory ); if ( ( filterAliasTableMaps[filterCount].isEmpty() || isTableFromPersistentClass( filterAliasTableMaps[filterCount] ) ) && filter .useAutoAliasInjection() ) { filterConditions[filterCount] = safeInterning( Template.renderWhereStringTemplate( filter.getCondition(), filterAutoAliasFlags[filterCount] = true; filterConditions[filterCount] = safeInterning( StringHelper.replace( filterConditions[filterCount],
@Override public String getTemplate(Dialect dialect, SqmFunctionRegistry functionRegistry) { return safeInterning( hasCustomRead() // see note in renderTransformerReadFragment wrt access to SessionFactory ? Template.renderTransformerReadFragment( customRead, getQuotedName( dialect ) ) : Template.TEMPLATE + '.' + name.render( dialect ) ); }
/** * If this is a quoted identifier, then return the identifier name * enclosed in dialect-specific open- and end-quotes; otherwise, * simply return the unquoted identifier. * * @param dialect The dialect whose dialect-specific quoting should be used. * * @return if quoted, identifier name enclosed in dialect-specific open- and * end-quotes; otherwise, the unquoted identifier. */ public String render(Dialect dialect) { return safeInterning( isQuoted ? dialect.openQuote() + getText() + dialect.closeQuote() : getText() ); }