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 @@ import org.hibernate.internal.util.StringHelper;
|
|||
* @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 class Identifier implements Comparable<Identifier> {
|
|||
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…
Reference in New Issue