@Override public Object getPropertyValue(Object component, int i, SharedSessionContractImplementor session) throws HibernateException { return getPropertyValue( component, i ); }
public Object getPropertyValue(Object component, int i, EntityMode entityMode) throws HibernateException { return getPropertyValue( component, i ); }
@Override public boolean isEqual(final Object x, final Object y) throws HibernateException { if ( x == y ) { return true; } // null value and empty component are considered equivalent for ( int i = 0; i < propertySpan; i++ ) { if ( !propertyTypes[i].isEqual( getPropertyValue( x, i ), getPropertyValue( y, i ) ) ) { return false; } } return true; }
@Override public boolean isDirty(final Object x, final Object y, final SharedSessionContractImplementor session) throws HibernateException { if ( x == y ) { return false; } // null value and empty component are considered equivalent for ( int i = 0; i < propertySpan; i++ ) { if ( propertyTypes[i].isDirty( getPropertyValue( x, i ), getPropertyValue( y, i ), session ) ) { return true; } } return false; }
@Override public int compare(final Object x, final Object y) { if ( x == y ) { return 0; } for ( int i = 0; i < propertySpan; i++ ) { int propertyCompare = propertyTypes[i].compare( getPropertyValue( x, i ), getPropertyValue( y, i ) ); if ( propertyCompare != 0 ) { return propertyCompare; } } return 0; }
@Override public boolean isEqual(final Object x, final Object y, final SessionFactoryImplementor factory) throws HibernateException { if ( x == y ) { return true; } // null value and empty component are considered equivalent for ( int i = 0; i < propertySpan; i++ ) { if ( !propertyTypes[i].isEqual( getPropertyValue( x, i ), getPropertyValue( y, i ), factory ) ) { return false; } } return true; }
@Override public int getHashCode(final Object x) { int result = 17; for ( int i = 0; i < propertySpan; i++ ) { Object y = getPropertyValue( x, i ); result *= 37; if ( y != null ) { result += propertyTypes[i].getHashCode( y ); } } return result; }
@Override public int getHashCode(final Object x, final SessionFactoryImplementor factory) { int result = 17; for ( int i = 0; i < propertySpan; i++ ) { Object y = getPropertyValue( x, i ); result *= 37; if ( y != null ) { result += propertyTypes[i].getHashCode( y, factory ); } } return result; }
if ( len <= 1 ) { final boolean dirty = ( len == 0 || checkable[loc] ) && propertyTypes[i].isDirty( getPropertyValue( x, i ), getPropertyValue( y, i ), session ); if ( dirty ) { return true; System.arraycopy( checkable, loc, subcheckable, 0, len ); final boolean dirty = propertyTypes[i].isDirty( getPropertyValue( x, i ), getPropertyValue( y, i ), subcheckable, session
@Override public boolean isModified( final Object old, final Object current, final boolean[] checkable, final SharedSessionContractImplementor session) throws HibernateException { if ( old == current ) { return false; } // null value and empty components are considered equivalent int loc = 0; for ( int i = 0; i < propertySpan; i++ ) { int len = propertyTypes[i].getColumnSpan( session.getFactory() ); boolean[] subcheckable = new boolean[len]; System.arraycopy( checkable, loc, subcheckable, 0, len ); if ( propertyTypes[i].isModified( getPropertyValue( old, i ), getPropertyValue( current, i ), subcheckable, session ) ) { return true; } loc += len; } return false; }
/** * 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; } }
final Object componentValue = componentType.getPropertyValue( value, i, session ); parameters.addWhereWithParam( alias,
public Object getPropertyValue(Object component, int i, SessionImplementor session) throws HibernateException { return getPropertyValue( component, i, entityMode ); }
public Object getPropertyValue(Object component, int i) throws HibernateException { return getPropertyValue(component, i, null); }
public Object getPropertyValue(Object component, int i, SessionImplementor session) throws HibernateException { return getPropertyValue( component, i, entityMode ); }
private Object getPropertyValue(Object obj, int ourIndex) { int theirIndex = propertyIndices.get( ourIndex ); return componentType.getPropertyValue( obj, theirIndex ); } }
public Object getPropertyValue(Object object, String property) { if (!type.isComponentType()) return null; int i = getPropertyIndex(property); if (i == -1) { return null; } else { return ((ComponentType)type).getPropertyValue(object, i, EntityMode.POJO); } }
/** * 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; } }