mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-19 17:45:10 +00:00
Use Property#getPropertyAccessStrategy which internally delegates to BuiltInPropertyAccessStrategies to handle enhanced cases
This commit is contained in:
parent
8e26756cce
commit
71f666f0b6
@ -83,16 +83,10 @@ public ReflectionOptimizer getReflectionOptimizer() {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected PropertyAccess buildPropertyAccess(Property bootAttributeDescriptor) {
|
protected PropertyAccess buildPropertyAccess(Property bootAttributeDescriptor) {
|
||||||
PropertyAccessStrategy strategy = null;
|
PropertyAccessStrategy strategy = bootAttributeDescriptor.getPropertyAccessStrategy( getEmbeddableJavaTypeDescriptor().getJavaTypeClass() );
|
||||||
final String propertyAccessorName = bootAttributeDescriptor.getPropertyAccessorName();
|
|
||||||
final BuiltInPropertyAccessStrategies namedStrategy = BuiltInPropertyAccessStrategies.interpret(
|
|
||||||
propertyAccessorName );
|
|
||||||
if ( namedStrategy != null ) {
|
|
||||||
strategy = namedStrategy.getStrategy();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( strategy == null ) {
|
if ( strategy == null ) {
|
||||||
|
final String propertyAccessorName = bootAttributeDescriptor.getPropertyAccessorName();
|
||||||
if ( StringHelper.isNotEmpty( propertyAccessorName ) ) {
|
if ( StringHelper.isNotEmpty( propertyAccessorName ) ) {
|
||||||
|
|
||||||
// handle explicitly specified attribute accessor
|
// handle explicitly specified attribute accessor
|
||||||
|
@ -320,17 +320,10 @@ private ReflectionOptimizer resolveReflectionOptimizer(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private PropertyAccess makePropertyAccess(Property bootAttributeDescriptor) {
|
private PropertyAccess makePropertyAccess(Property bootAttributeDescriptor) {
|
||||||
PropertyAccessStrategy strategy = null;
|
PropertyAccessStrategy strategy = bootAttributeDescriptor.getPropertyAccessStrategy( mappedJtd.getJavaTypeClass() );
|
||||||
|
|
||||||
final String propertyAccessorName = bootAttributeDescriptor.getPropertyAccessorName();
|
|
||||||
final BuiltInPropertyAccessStrategies namedStrategy = BuiltInPropertyAccessStrategies.interpret(
|
|
||||||
propertyAccessorName );
|
|
||||||
|
|
||||||
if ( namedStrategy != null ) {
|
|
||||||
strategy = namedStrategy.getStrategy();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( strategy == null ) {
|
if ( strategy == null ) {
|
||||||
|
final String propertyAccessorName = bootAttributeDescriptor.getPropertyAccessorName();
|
||||||
if ( StringHelper.isNotEmpty( propertyAccessorName ) ) {
|
if ( StringHelper.isNotEmpty( propertyAccessorName ) ) {
|
||||||
// handle explicitly specified attribute accessor
|
// handle explicitly specified attribute accessor
|
||||||
strategy = strategySelector.resolveStrategy( PropertyAccessStrategy.class, propertyAccessorName );
|
strategy = strategySelector.resolveStrategy( PropertyAccessStrategy.class, propertyAccessorName );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user