@Override public boolean isModified( Object old, Object current, boolean[] checkable, SharedSessionContractImplementor session) throws HibernateException { if ( current == null ) { return old!=null; } if ( old == null ) { // we already know current is not null... return true; } // the ids are fully resolved, so compare them with isDirty(), not isModified() return getIdentifierOrUniqueKeyType( session.getFactory() ) .isDirty( old, getIdentifier( current, session ), session ); }
@Override public Object hydrate( ResultSet rs, String[] names, SharedSessionContractImplementor session, Object owner) throws HibernateException, SQLException { // return the (fully resolved) identifier value, but do not resolve // to the actual referenced entity instance // NOTE: the owner of the association is not really the owner of the id! // First hydrate the ID to check if it is null. // Don't bother resolving the ID if hydratedKeyState[i] is null. // Implementation note: if id is a composite ID, then resolving a null value will // result in instantiating an empty composite if AvailableSettings#CREATE_EMPTY_COMPOSITES_ENABLED // is true. By not resolving a null value for a composite ID, we avoid the overhead of instantiating // an empty composite, checking if it is equivalent to null (it should be), then ultimately throwing // out the empty value. final Object hydratedId = getIdentifierOrUniqueKeyType( session.getFactory() ) .hydrate( rs, names, session, null ); final Serializable id; if ( hydratedId != null ) { id = (Serializable) getIdentifierOrUniqueKeyType( session.getFactory() ) .resolve( hydratedId, session, null ); } else { id = null; } scheduleBatchLoadIfNeeded( id, session ); return id; }
public int getColumnSpan(Mapping mapping) throws MappingException { // our column span is the number of columns in the PK return getIdentifierOrUniqueKeyType( mapping ).getColumnSpan( mapping ); }
public void nullSafeSet( PreparedStatement st, Object value, int index, SessionImplementor session) throws HibernateException, SQLException { getIdentifierOrUniqueKeyType( session.getFactory() ) .nullSafeSet( st, getIdentifier( value, session ), index, session ); }
@Override public Size[] defaultSizes(Mapping mapping) throws MappingException { return getIdentifierOrUniqueKeyType( mapping ).defaultSizes( mapping ); }
@Override public Size[] dictatedSizes(Mapping mapping) throws MappingException { return getIdentifierOrUniqueKeyType( mapping ).dictatedSizes( mapping ); }
public int getColumnSpan(Mapping mapping) throws MappingException { // our column span is the number of columns in the PK return getIdentifierOrUniqueKeyType( mapping ).getColumnSpan( mapping ); }
public int getColumnSpan(Mapping mapping) throws MappingException { return getIdentifierOrUniqueKeyType(mapping).getColumnSpan(mapping); }
public int[] sqlTypes(Mapping mapping) throws MappingException { return getIdentifierOrUniqueKeyType(mapping).sqlTypes(mapping); }
public int[] sqlTypes(Mapping mapping) throws MappingException { return getIdentifierOrUniqueKeyType( mapping ).sqlTypes( mapping ); }
public int[] sqlTypes(Mapping mapping) throws MappingException { return getIdentifierOrUniqueKeyType( mapping ).sqlTypes( mapping ); }
public Object hydrate( ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException { // return the (fully resolved) identifier value, but do not resolve // to the actual referenced entity instance // NOTE: the owner of the association is not really the owner of the id! Serializable id = (Serializable) getIdentifierOrUniqueKeyType( session.getFactory() ) .nullSafeGet( rs, names, session, null ); scheduleBatchLoadIfNeeded( id, session ); return id; }
public Object hydrate(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException { Serializable id = (Serializable) getIdentifierOrUniqueKeyType( session.getFactory() ) .nullSafeGet(rs, names, session, null); //note that the owner of the association is not really the owner of the id! if (id!=null) scheduleBatchLoad(id, session); return id; }
public void nullSafeSet(PreparedStatement st, Object value, int index, SessionImplementor session) throws HibernateException, SQLException { getIdentifierOrUniqueKeyType( session.getFactory() ) .nullSafeSet(st, getIdentifier(value, session), index, session); }
public void nullSafeSet(PreparedStatement st, Object value, int index, boolean[] settable, SessionImplementor session) throws HibernateException, SQLException { getIdentifierOrUniqueKeyType( session.getFactory() ) .nullSafeSet(st, getIdentifier(value, session), index, settable, session); }
public boolean isModified(Object old, Object current, SessionImplementor session) throws HibernateException { if (current==null) return old!=null; if (old==null) return current!=null; return getIdentifierOrUniqueKeyType( session.getFactory() ) .isModified( old, getIdentifier(current, session), session ); }
public void nullSafeSet( PreparedStatement st, Object value, int index, boolean[] settable, SessionImplementor session) throws HibernateException, SQLException { getIdentifierOrUniqueKeyType( session.getFactory() ) .nullSafeSet( st, getIdentifier( value, session ), index, settable, session ); }
public void nullSafeSet( PreparedStatement st, Object value, int index, SessionImplementor session) throws HibernateException, SQLException { getIdentifierOrUniqueKeyType( session.getFactory() ) .nullSafeSet( st, getIdentifier( value, session ), index, session ); }
public Object hydrate( ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException { // return the (fully resolved) identifier value, but do not resolve // to the actual referenced entity instance // NOTE: the owner of the association is not really the owner of the id! Serializable id = (Serializable) getIdentifierOrUniqueKeyType( session.getFactory() ) .nullSafeGet( rs, names, session, null ); scheduleBatchLoadIfNeeded( id, session ); return id; }
public void nullSafeSet( PreparedStatement st, Object value, int index, SessionImplementor session) throws HibernateException, SQLException { getIdentifierOrUniqueKeyType( session.getFactory() ) .nullSafeSet( st, getIdentifier( value, session ), index, session ); }