AbstractEntityLoaderpublic abstract class AbstractEntityLoader extends org.hibernate.loader.OuterJoinLoader implements UniqueEntityLoader
Fields Summary |
---|
protected static final Log | log | protected final org.hibernate.persister.entity.OuterJoinLoadable | persister | protected final org.hibernate.type.Type | uniqueKeyType | protected final String | entityName |
Methods Summary |
---|
protected java.lang.Object | getResultColumnOrRow(java.lang.Object[] row, org.hibernate.transform.ResultTransformer transformer, java.sql.ResultSet rs, org.hibernate.engine.SessionImplementor session)
return row[row.length-1];
| protected boolean | isSingleRowLoader()
return true;
| public java.lang.Object | load(java.io.Serializable id, java.lang.Object optionalObject, org.hibernate.engine.SessionImplementor session)
return load(session, id, optionalObject, id);
| protected java.lang.Object | load(org.hibernate.engine.SessionImplementor session, java.lang.Object id, java.lang.Object optionalObject, java.io.Serializable optionalId)
List list = loadEntity(
session,
id,
uniqueKeyType,
optionalObject,
entityName,
optionalId,
persister
);
if ( list.size()==1 ) {
return list.get(0);
}
else if ( list.size()==0 ) {
return null;
}
else {
if ( getCollectionOwners()!=null ) {
return list.get(0);
}
else {
throw new HibernateException(
"More than one row with the given identifier was found: " +
id +
", for class: " +
persister.getEntityName()
);
}
}
|
|