-
Notifications
You must be signed in to change notification settings - Fork 3.6k
HHH-15862 Support basic array values in aggregate components #7577
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
...re/src/test/java/org/hibernate/orm/test/mapping/embeddable/EmbeddableWithArrayAggregate.java
Fixed
Show fixed
Hide fixed
Class<?> javaTypeClass = jdbcMapping.getJavaTypeDescriptor().getJavaTypeClass(); | ||
if ( javaTypeClass == Boolean.class ) { | ||
// BooleanJavaType has this as an implicit conversion | ||
return Integer.parseInt( string, start, end, 10 ) == 1; |
Check notice
Code scanning / CodeQL
Missing catch of NumberFormatException
return Integer.parseInt( string, start, end, 10 ) == 1; | ||
} | ||
if ( javaTypeClass.isEnum() ) { | ||
return javaTypeClass.getEnumConstants()[Integer.parseInt( string, start, end, 10 )]; |
Check notice
Code scanning / CodeQL
Missing catch of NumberFormatException
598b668
to
5faaa37
Compare
throw new SemanticException( | ||
"Oracle array_agg emulation requires a basic plural return type, but resolved return type was: " + returnType | ||
); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation
return resolveFunctionReturnType( | ||
impliedType, | ||
converter == null ? () -> null : converter::resolveFunctionImpliedReturnType, | ||
arguments, | ||
typeConfiguration | ||
); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation
84a17ac
to
557bc01
Compare
Thanks for your pull request! This pull request appears to follow the contribution rules. › This message was automatically generated. |
...test/java/org/hibernate/orm/test/mapping/embeddable/NestedStructWithArrayEmbeddableTest.java
Fixed
Show fixed
Hide fixed
hibernate-core/src/main/java/org/hibernate/mapping/UserDefinedObjectType.java
Fixed
Show fixed
Hide fixed
hibernate-core/src/main/java/org/hibernate/mapping/UserDefinedArrayType.java
Fixed
Show fixed
Hide fixed
@@ -125,4 +161,8 @@ | |||
|
|||
return new String[] { buf.toString() }; | |||
} | |||
|
|||
public String[] getSqlDropStrings(UserDefinedArrayType userDefinedType, Metadata metadata, SqlStringGenerationContext context) { |
Check notice
Code scanning / CodeQL
Useless parameter
} | ||
} | ||
|
||
public String[] getSqlDropStrings(UserDefinedObjectType userDefinedType, Metadata metadata, SqlStringGenerationContext context) { |
Check notice
Code scanning / CodeQL
Useless parameter
...e-core/src/main/java/org/hibernate/type/descriptor/java/spi/EmbeddableAggregateJavaType.java
Fixed
Show fixed
Hide fixed
...e-core/src/main/java/org/hibernate/type/descriptor/java/spi/EmbeddableAggregateJavaType.java
Fixed
Show fixed
Hide fixed
...e-core/src/main/java/org/hibernate/type/descriptor/java/spi/EmbeddableAggregateJavaType.java
Fixed
Show fixed
Hide fixed
...e-core/src/main/java/org/hibernate/type/descriptor/java/spi/EmbeddableAggregateJavaType.java
Fixed
Show fixed
Hide fixed
...e-core/src/main/java/org/hibernate/type/descriptor/java/spi/EmbeddableAggregateJavaType.java
Fixed
Show fixed
Hide fixed
6fe0458
to
879b701
Compare
Some notes on changes that we might want to discuss:
=> Allow resolving the correct type for native query results e.g. named array etc.
=> Needed to understand dependencies between named array types and the object type during DDL generation
=> Small breakage? some methods in e.g. ColumnOrderingStrategy, Namespace
=> Should be fine since it's incubating
=> Is probably going to cause trouble with ORM 7 rebase?
=> Model a column with a base expression e.g.
array_get(...).columnName
=> UnresolvedStructJdbcType is a "temporary" descriptor. The BasicType with the proper JdbcType is registered when EmbeddableMappingTypeImpl is constructed
=> Needed for the bootstrap process. StructJdbcType implementations depend on EmbeddableMappingType, but need a temporary JdbcType for attributes until EmbeddableMappingTypeImpl is constructed
=> This in turn requires a JdbcMapping overriding mechanism in InferredBasicValueResolution via #updatedType
=> When EmbeddableMappingTypeImpl is built, the correct StructJdbcType is built, as well as BasicType, which needs is then updated in the Resolution
=> Called when basic attributes are built: AbstractEntityPersister, AbstractEmbeddableMapping, EmbeddableMappingTypeImpl
=> Necessary to allow saving structs with nested arrays etc.
https://hibernate.atlassian.net/browse/HHH-15862