HHH-6365 : Use Identifier.toIdentifier() to create column names
This commit is contained in:
parent
6499491374
commit
88f69a135b
|
@ -32,7 +32,7 @@ import org.hibernate.metamodel.relational.state.ColumnRelationalState;
|
|||
* @author Steve Ebersole
|
||||
*/
|
||||
public class Column extends AbstractSimpleValue implements SimpleValue {
|
||||
private final Identifier name;
|
||||
private final Identifier columnName;
|
||||
private boolean nullable;
|
||||
private boolean unique;
|
||||
|
||||
|
@ -53,7 +53,7 @@ public class Column extends AbstractSimpleValue implements SimpleValue {
|
|||
|
||||
protected Column(TableSpecification table, int position, Identifier name) {
|
||||
super( table, position );
|
||||
this.name = name;
|
||||
this.columnName = name;
|
||||
}
|
||||
|
||||
public void initialize(ColumnRelationalState state, boolean forceNonNullable, boolean forceUnique) {
|
||||
|
@ -76,8 +76,8 @@ public class Column extends AbstractSimpleValue implements SimpleValue {
|
|||
}
|
||||
}
|
||||
|
||||
public Identifier getName() {
|
||||
return name;
|
||||
public Identifier getColumnName() {
|
||||
return columnName;
|
||||
}
|
||||
|
||||
public boolean isNullable() {
|
||||
|
@ -154,6 +154,6 @@ public class Column extends AbstractSimpleValue implements SimpleValue {
|
|||
|
||||
@Override
|
||||
public String toLoggableString() {
|
||||
return getTable().getLoggableValueQualifier() + '.' + getName();
|
||||
return getTable().getLoggableValueQualifier() + '.' + getColumnName();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -109,7 +109,7 @@ public class TableBinder {
|
|||
private static Column findColumn(Table table, String columnName) {
|
||||
Column column = null;
|
||||
for ( SimpleValue value : table.values() ) {
|
||||
if ( value instanceof Column && ( (Column) value ).getName().equals( columnName ) ) {
|
||||
if ( value instanceof Column && ( (Column) value ).getColumnName().getName().equals( columnName ) ) {
|
||||
column = (Column) value;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -67,7 +67,7 @@ public class TableManipulationTests extends BaseUnitTestCase {
|
|||
for ( Value value : table.values() ) {
|
||||
assertTrue( Column.class.isInstance( value ) );
|
||||
Column column = ( Column ) value;
|
||||
if ( column.getName().equals( Identifier.toIdentifier( "id" ) ) ) {
|
||||
if ( column.getColumnName().getName().equals( "id" ) ) {
|
||||
assertEquals( INTEGER, column.getDatatype() );
|
||||
assertEquals( 18, column.getSize().getPrecision() );
|
||||
assertEquals( 0, column.getSize().getScale() );
|
||||
|
@ -75,7 +75,7 @@ public class TableManipulationTests extends BaseUnitTestCase {
|
|||
assertNull( column.getSize().getLobMultiplier() );
|
||||
}
|
||||
else {
|
||||
assertEquals( Identifier.toIdentifier( "col_1" ), column.getName() );
|
||||
assertEquals( "col_1", column.getColumnName().getName() );
|
||||
assertEquals( VARCHAR, column.getDatatype() );
|
||||
assertEquals( -1, column.getSize().getPrecision() );
|
||||
assertEquals( -1, column.getSize().getScale() );
|
||||
|
|
Loading…
Reference in New Issue