@Override public int compareTo(Object other) { final EntityAction action = (EntityAction) other; //sort first by entity name final int roleComparison = entityName.compareTo( action.entityName ); if ( roleComparison != 0 ) { return roleComparison; } else { //then by id return persister.getIdentifierType().compare( id, action.id ); } }
@Override public int compareTo(Object other) { final CollectionAction action = (CollectionAction) other; // sort first by role name final int roleComparison = collectionRole.compareTo( action.collectionRole ); if ( roleComparison != 0 ) { return roleComparison; } else { //then by fk return persister.getKeyType().compare( key, action.key ); } }
@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 int compare(Object x, Object y) { if ( x == null ) { // if y is also null, return that they are the same (no option for "UNKNOWN") // if y is not null, return that y is "greater" (-1 because the result is from the perspective of // the first arg: x) return y == null ? 0 : -1; } else if ( y == null ) { // x is not null, but y is. return that x is "greater" return 1; } // At this point we know both are non-null. final Object xId = extractIdentifier( x ); final Object yId = extractIdentifier( y ); return getIdentifierType().compare( xId, yId ); }
@Override public int compare(Object x, Object y) { return delegate.compare( x, y ); }
@Override public int compareTo(Object other) { EntityAction action = ( EntityAction ) other; //sort first by entity name int roleComparison = entityName.compareTo( action.entityName ); if ( roleComparison != 0 ) { return roleComparison; } else { //then by id return persister.getIdentifierType().compare( id, action.id ); } }
@Override public int compareTo(Object other) { CollectionAction action = ( CollectionAction ) other; //sort first by role name int roleComparison = collectionRole.compareTo( action.collectionRole ); if ( roleComparison != 0 ) { return roleComparison; } else { //then by fk return persister.getKeyType() .compare( key, action.key ); } }
@Override public int compareTo(Object other) { EntityAction action = ( EntityAction ) other; //sort first by entity name int roleComparison = entityName.compareTo( action.entityName ); if ( roleComparison != 0 ) { return roleComparison; } else { //then by id return persister.getIdentifierType().compare( id, action.id ); } }
@Override public int compareTo(Object other) { CollectionAction action = ( CollectionAction ) other; //sort first by role name int roleComparison = collectionRole.compareTo( action.collectionRole ); if ( roleComparison != 0 ) { return roleComparison; } else { //then by fk return persister.getKeyType() .compare( key, action.key ); } }
public int compareTo(Object other) { CollectionAction action = ( CollectionAction ) other; //sort first by role name int roleComparison = collectionRole.compareTo( action.collectionRole ); if ( roleComparison != 0 ) { return roleComparison; } else { //then by fk return persister.getKeyType() .compare( key, action.key, session.getEntityMode() ); } } }
public int compareTo(Object other) { CollectionAction action = ( CollectionAction ) other; //sort first by role name int roleComparison = collectionRole.compareTo( action.collectionRole ); if ( roleComparison != 0 ) { return roleComparison; } else { //then by fk return persister.getKeyType().compare( key, action.key, session.getEntityMode() ); } } }
public int compareTo(Object other) { EntityAction action = ( EntityAction ) other; //sort first by entity name int roleComparison = entityName.compareTo( action.entityName ); if ( roleComparison != 0 ) { return roleComparison; } else { //then by id return persister.getIdentifierType().compare( id, action.id, session.getEntityMode() ); } } }
public int compareTo(Object other) { EntityAction action = ( EntityAction ) other; //sort first by entity name int roleComparison = entityName.compareTo( action.entityName ); if ( roleComparison != 0 ) { return roleComparison; } else { //then by id return persister.getIdentifierType() .compare( id, action.id, session.getEntityMode() ); } } }
public int compare(Object x, Object y, EntityMode entityMode) { if ( x == y ) return 0; Object[] xvalues = getPropertyValues(x, entityMode); Object[] yvalues = getPropertyValues(y, entityMode); for ( int i = 0; i < propertySpan; i++ ) { int propertyCompare = propertyTypes[i].compare( xvalues[i], yvalues[i], entityMode ); if ( propertyCompare != 0 ) return propertyCompare; } return 0; }
public int compare(Object x, Object y, EntityMode entityMode) { if ( x == y ) { return 0; } Object[] xvalues = getPropertyValues( x, entityMode ); Object[] yvalues = getPropertyValues( y, entityMode ); for ( int i = 0; i < propertySpan; i++ ) { int propertyCompare = propertyTypes[i].compare( xvalues[i], yvalues[i], entityMode ); if ( propertyCompare != 0 ) { return propertyCompare; } } return 0; }
@Override public int compare(Object x, Object y) { if ( x == y ) { return 0; } Object[] xvalues = getPropertyValues( x, entityMode ); Object[] yvalues = getPropertyValues( y, entityMode ); for ( int i = 0; i < propertySpan; i++ ) { int propertyCompare = propertyTypes[i].compare( xvalues[i], yvalues[i] ); if ( propertyCompare != 0 ) { return propertyCompare; } } return 0; }
@Override public int compare(Object x, Object y) { if ( x == y ) { return 0; } Object[] xvalues = getPropertyValues( x, entityMode ); Object[] yvalues = getPropertyValues( y, entityMode ); for ( int i = 0; i < propertySpan; i++ ) { int propertyCompare = propertyTypes[i].compare( xvalues[i], yvalues[i] ); if ( propertyCompare != 0 ) { return propertyCompare; } } return 0; }