/** * Normalizes the quoting of identifiers. * <p/> * This implements the rules set forth in JPA 2 (section "2.13 Naming of Database Objects") which * states that the double-quote (") is the character which should be used to denote a <tt>quoted * identifier</tt>. Here, we handle recognizing that and converting it to the more elegant * bactick (`) approach used in Hibernate.. Additionally we account for applying what JPA2 terms * "globally quoted identifiers". * * @param identifierText The identifier to be quoting-normalized. * @return The identifier accounting for any quoting that need be applied. */ public Identifier normalizeIdentifierQuoting(String identifierText) { return database().toIdentifier( identifierText ); }
/** * Intended only for use in handling quoting requirements for {@code column-definition} * as defined by {@link javax.persistence.Column#columnDefinition()}, * {@link javax.persistence.JoinColumn#columnDefinition}, etc. This method should not * be called in any other scenario. * * @param text The specified column definition * * @return The name with global quoting applied */ public String applyGlobalQuoting(String text) { return database().getJdbcEnvironment().getIdentifierHelper().applyGlobalQuoting( text ) .render( database().getDialect() ); }
public String toDatabaseIdentifierText(String identifierText) { return database().getDialect().quote( normalizeIdentifierQuotingAsString( identifierText ) ); }
/** * Normalizes the quoting of identifiers. This form returns a String rather than an Identifier * to better work with the legacy code in {@link org.hibernate.mapping} * * @param identifierText The identifier to be quoting-normalized. * @return The identifier accounting for any quoting that need be applied. */ public String normalizeIdentifierQuotingAsString(String identifierText) { final Identifier identifier = normalizeIdentifierQuoting( identifierText ); if ( identifier == null ) { return null; } return identifier.render( database().getDialect() ); }
/** * Normalizes the quoting of identifiers. * <p/> * This implements the rules set forth in JPA 2 (section "2.13 Naming of Database Objects") which * states that the double-quote (") is the character which should be used to denote a <tt>quoted * identifier</tt>. Here, we handle recognizing that and converting it to the more elegant * bactick (`) approach used in Hibernate.. Additionally we account for applying what JPA2 terms * "globally quoted identifiers". * * @param identifierText The identifier to be quoting-normalized. * @return The identifier accounting for any quoting that need be applied. */ public Identifier normalizeIdentifierQuoting(String identifierText) { return database().toIdentifier( identifierText ); }
/** * Intended only for use in handling quoting requirements for {@code column-definition} * as defined by {@link javax.persistence.Column#columnDefinition()}, * {@link javax.persistence.JoinColumn#columnDefinition}, etc. This method should not * be called in any other scenario. * * @param text The specified column definition * * @return The name with global quoting applied */ public String applyGlobalQuoting(String text) { return database().getJdbcEnvironment().getIdentifierHelper().applyGlobalQuoting( text ) .render( database().getDialect() ); }
/** * Normalizes the quoting of identifiers. This form returns a String rather than an Identifier * to better work with the legacy code in {@link org.hibernate.mapping} * * @param identifierText The identifier to be quoting-normalized. * @return The identifier accounting for any quoting that need be applied. */ public String normalizeIdentifierQuotingAsString(String identifierText) { final Identifier identifier = normalizeIdentifierQuoting( identifierText ); if ( identifier == null ) { return null; } return identifier.render( database().getDialect() ); }
public String toDatabaseIdentifierText(String identifierText) { return database().getDialect().quote( normalizeIdentifierQuotingAsString( identifierText ) ); }