mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-17 08:35:13 +00:00
HHH-11915 - DatabaseMetaData#getIndexInfo can return column names enclosed in quotes on PostgresPlus
This commit is contained in:
parent
fd2dab3297
commit
65b5e6445b
@ -14,19 +14,26 @@
|
||||
* @author Andrea Boriero
|
||||
*/
|
||||
public class DatabaseIdentifier extends Identifier {
|
||||
protected DatabaseIdentifier(String text) {
|
||||
super( text );
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a datatabase identifier instance.
|
||||
*
|
||||
* @param text The identifier text.
|
||||
*/
|
||||
public DatabaseIdentifier(String text) {
|
||||
super( text, false );
|
||||
}
|
||||
|
||||
public static DatabaseIdentifier toIdentifier(String text) {
|
||||
if ( StringHelper.isEmpty( text ) ) {
|
||||
return null;
|
||||
}
|
||||
return new DatabaseIdentifier( text );
|
||||
else if ( isQuoted( text ) ) {
|
||||
// exclude the quotes from text
|
||||
final String unquotedtext = text.substring( 1, text.length() - 1 );
|
||||
return new DatabaseIdentifier( unquotedtext );
|
||||
}
|
||||
else {
|
||||
return new DatabaseIdentifier( text );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -113,6 +113,16 @@ public Identifier(String text, boolean quoted) {
|
||||
this.isQuoted = quoted;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs an unquoted identifier instance.
|
||||
*
|
||||
* @param text The identifier text.
|
||||
*/
|
||||
protected Identifier(String text) {
|
||||
this.text = text;
|
||||
this.isQuoted = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the identifiers name (text)
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user