fix @Column(precision=p) with TimeZoneStorageType.COLUMN
This commit is contained in:
parent
cceac72a22
commit
512ad8c80d
|
@ -525,11 +525,17 @@ public abstract class AbstractPropertyHolder implements PropertyHolder {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Column createTimestampColumn(XAnnotatedElement element, String path, MetadataBuildingContext context) {
|
private static Column createTimestampColumn(XAnnotatedElement element, String path, MetadataBuildingContext context) {
|
||||||
|
int precision;
|
||||||
final Column annotatedColumn = element.getAnnotation( Column.class );
|
final Column annotatedColumn = element.getAnnotation( Column.class );
|
||||||
if ( annotatedColumn != null ) {
|
if ( annotatedColumn != null ) {
|
||||||
|
if ( !annotatedColumn.name().isEmpty() ) {
|
||||||
return annotatedColumn;
|
return annotatedColumn;
|
||||||
}
|
}
|
||||||
|
precision = annotatedColumn.precision();
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
|
precision = 0;
|
||||||
|
}
|
||||||
// Base the name of the synthetic dateTime field on the name of the original attribute
|
// Base the name of the synthetic dateTime field on the name of the original attribute
|
||||||
final Identifier implicitName = context.getObjectNameNormalizer().normalizeIdentifierQuoting(
|
final Identifier implicitName = context.getObjectNameNormalizer().normalizeIdentifierQuoting(
|
||||||
context.getBuildingOptions().getImplicitNamingStrategy().determineBasicColumnName(
|
context.getBuildingOptions().getImplicitNamingStrategy().determineBasicColumnName(
|
||||||
|
@ -561,10 +567,9 @@ public abstract class AbstractPropertyHolder implements PropertyHolder {
|
||||||
true,
|
true,
|
||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
0
|
precision
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private static Map<String, ColumnTransformer> buildColumnTransformerOverride(XAnnotatedElement element) {
|
private static Map<String, ColumnTransformer> buildColumnTransformerOverride(XAnnotatedElement element) {
|
||||||
Map<String, ColumnTransformer> columnOverride = new HashMap<>();
|
Map<String, ColumnTransformer> columnOverride = new HashMap<>();
|
||||||
|
|
Loading…
Reference in New Issue