return null; return getComponentValue( (ComponentType) entityMetamodel.getPropertyTypes()[index], baseValue,
/** * Extract a component property value. * * @param type The component property types. * @param component The component instance itself. * @param propertyPath The property path for the property to be extracted. * * @return The property value extracted. */ protected Object getComponentValue(ComponentType type, Object component, String propertyPath) { final int loc = propertyPath.indexOf( '.' ); final String basePropertyName = loc > 0 ? propertyPath.substring( 0, loc ) : propertyPath; final int index = findSubPropertyIndex( type, basePropertyName ); final Object baseValue = type.getPropertyValue( component, index ); if ( loc > 0 ) { if ( baseValue == null ) { return null; } return getComponentValue( (ComponentType) type.getSubtypes()[index], baseValue, propertyPath.substring( loc + 1 ) ); } else { return baseValue; } }
public Object getPropertyValue(Object entity, String propertyPath) throws HibernateException { int loc = propertyPath.indexOf('.'); String basePropertyName = loc > 0 ? propertyPath.substring( 0, loc ) : propertyPath; //final int index = entityMetamodel.getPropertyIndexOrNull( basePropertyName ); Integer index = entityMetamodel.getPropertyIndexOrNull( basePropertyName ); if (index == null) { propertyPath = "_identifierMapper." + propertyPath; loc = propertyPath.indexOf('.'); basePropertyName = loc > 0 ? propertyPath.substring( 0, loc ) : propertyPath; } index = entityMetamodel.getPropertyIndexOrNull( basePropertyName ); final Object baseValue = getPropertyValue( entity, index.intValue() ); if ( loc > 0 ) { if ( baseValue == null ) { return null; } return getComponentValue( (ComponentType) entityMetamodel.getPropertyTypes()[index.intValue()], baseValue, propertyPath.substring(loc+1) ); } else { return baseValue; } }
public Object getPropertyValue(Object entity, String propertyPath) throws HibernateException { int loc = propertyPath.indexOf('.'); String basePropertyName = loc > 0 ? propertyPath.substring( 0, loc ) : propertyPath; //final int index = entityMetamodel.getPropertyIndexOrNull( basePropertyName ); Integer index = entityMetamodel.getPropertyIndexOrNull( basePropertyName ); if (index == null) { propertyPath = "_identifierMapper." + propertyPath; loc = propertyPath.indexOf('.'); basePropertyName = loc > 0 ? propertyPath.substring( 0, loc ) : propertyPath; } index = entityMetamodel.getPropertyIndexOrNull( basePropertyName ); final Object baseValue = getPropertyValue( entity, index.intValue() ); if ( loc > 0 ) { if ( baseValue == null ) { return null; } return getComponentValue( (ComponentType) entityMetamodel.getPropertyTypes()[index.intValue()], baseValue, propertyPath.substring(loc+1) ); } else { return baseValue; } }
/** * Extract a component property value. * * @param type The component property types. * @param component The component instance itself. * @param propertyPath The property path for the property to be extracted. * @return The property value extracted. */ protected Object getComponentValue(ComponentType type, Object component, String propertyPath) { final int loc = propertyPath.indexOf( '.' ); final String basePropertyName = loc > 0 ? propertyPath.substring( 0, loc ) : propertyPath; final int index = findSubPropertyIndex( type, basePropertyName ); final Object baseValue = type.getPropertyValue( component, index, getEntityMode() ); if ( loc > 0 ) { if ( baseValue == null ) { return null; } return getComponentValue( (ComponentType) type.getSubtypes()[index], baseValue, propertyPath.substring(loc+1) ); } else { return baseValue; } }
/** * Extract a component property value. * * @param type The component property types. * @param component The component instance itself. * @param propertyPath The property path for the property to be extracted. * @return The property value extracted. */ protected Object getComponentValue(ComponentType type, Object component, String propertyPath) { final int loc = propertyPath.indexOf( '.' ); final String basePropertyName = loc > 0 ? propertyPath.substring( 0, loc ) : propertyPath; final int index = findSubPropertyIndex( type, basePropertyName ); final Object baseValue = type.getPropertyValue( component, index, getEntityMode() ); if ( loc > 0 ) { if ( baseValue == null ) { return null; } return getComponentValue( (ComponentType) type.getSubtypes()[index], baseValue, propertyPath.substring(loc+1) ); } else { return baseValue; } }