Search in sources :

Example 1 with PropertyAccessStrategy

use of org.hibernate.property.access.spi.PropertyAccessStrategy in project hibernate-orm by hibernate.

the class PropertyFactory method getGetter.

private static Getter getGetter(Property mappingProperty) {
    if (mappingProperty == null || !mappingProperty.getPersistentClass().hasPojoRepresentation()) {
        return null;
    }
    final PropertyAccessStrategyResolver propertyAccessStrategyResolver = mappingProperty.getPersistentClass().getServiceRegistry().getService(PropertyAccessStrategyResolver.class);
    final PropertyAccessStrategy propertyAccessStrategy = propertyAccessStrategyResolver.resolvePropertyAccessStrategy(mappingProperty.getClass(), mappingProperty.getPropertyAccessorName(), EntityMode.POJO);
    final PropertyAccess propertyAccess = propertyAccessStrategy.buildPropertyAccess(mappingProperty.getPersistentClass().getMappedClass(), mappingProperty.getName());
    return propertyAccess.getGetter();
}
Also used : PropertyAccessStrategy(org.hibernate.property.access.spi.PropertyAccessStrategy) PropertyAccessStrategyResolver(org.hibernate.property.access.spi.PropertyAccessStrategyResolver) PropertyAccess(org.hibernate.property.access.spi.PropertyAccess)

Aggregations

PropertyAccess (org.hibernate.property.access.spi.PropertyAccess)1 PropertyAccessStrategy (org.hibernate.property.access.spi.PropertyAccessStrategy)1 PropertyAccessStrategyResolver (org.hibernate.property.access.spi.PropertyAccessStrategyResolver)1