Skip to content

Instantly share code, notes, and snippets.

@sebersole
Last active August 29, 2015 14:21
Show Gist options
  • Save sebersole/46b5b7968e748648f562 to your computer and use it in GitHub Desktop.
Save sebersole/46b5b7968e748648f562 to your computer and use it in GitHub Desktop.
Dialect#buildIdentifierHelper
public class Dialect {
....
/**
* Build the IdentifierHelper indicated by this Dialect for handling
* {@link Identifier identifier) conversions. Returning {@code null} is
* allowed and indicates that Hibernate should fallback to building a
* "standard" helper. In the fallback path, any changes made to
* the IdentifierHelperBuilder during this call will still be incorporated
* into the built IdentifierHelper
*
* @param builder A semi-configured IdentifierHelper builder.
* @param dbMetaData Access to the metadata returned from the driver if needed and if available. WARNING: may be {@code null}
*
* @return The IdentifierHelper instance to use, or {@code null} to indicate Hibernate should use its fallback path
*/
public IdentifierHelper buildIdentifierHelper(IdentifierHelperBuilder builder, DatabaseMetaData dbMetaData) {
}
}
public enum IdentifierCaseStrategy {
UPPER, LOWER, MIXED
}
public class IdentifierHelperBuilder {
private boolean globalQuoting = false;
private Set<String> reservedWords = new TreeSet<String>( String.CASE_INSENSITIVE_ORDER );
private IdentifierCaseStrategy unquotedCaseStrategy = IdentifierCaseStrategy.UPPER;
private IdentifierCaseStrategy quotedCaseStrategy = IdentifierCaseStrategy.MIXED;
private NameQualifierSupport nameQualifierSupport;
// mutators
public IdentifierHelper build() {
return ...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment