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; }