HHH-14776 Promote method instantiate(EntityPersister, Serializable) from SessionImplementor to SharedSessionContractImplementor
This commit is contained in:
parent
9a335c1c04
commit
edcce3e1c2
|
@ -78,8 +78,6 @@ public interface SessionImplementor
|
|||
|
||||
ActionQueue getActionQueue();
|
||||
|
||||
Object instantiate(EntityPersister persister, Serializable id) throws HibernateException;
|
||||
|
||||
void forceFlush(EntityEntry e) throws HibernateException;
|
||||
|
||||
@Override
|
||||
|
|
|
@ -333,6 +333,13 @@ public interface SharedSessionContractImplementor
|
|||
*/
|
||||
Object instantiate(String entityName, Serializable id) throws HibernateException;
|
||||
|
||||
/**
|
||||
* Instantiate the entity class of an EntityPersister, initializing with the given identifier.
|
||||
* This is more efficient than {@link #instantiate(String, Serializable)} but not always
|
||||
* interchangeable: a single persister might be responsible for multiple types.
|
||||
*/
|
||||
Object instantiate(EntityPersister persister, Serializable id) throws HibernateException;
|
||||
|
||||
/**
|
||||
* Execute an SQL Query
|
||||
*/
|
||||
|
|
|
@ -275,8 +275,13 @@ public class StatelessSessionImpl extends AbstractSharedSessionContract implemen
|
|||
public Object instantiate(
|
||||
String entityName,
|
||||
Serializable id) throws HibernateException {
|
||||
return instantiate( getFactory().getMetamodel().entityPersister( entityName ), id );
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object instantiate(EntityPersister persister, Serializable id) throws HibernateException {
|
||||
checkOpen();
|
||||
return getFactory().getMetamodel().entityPersister( entityName ).instantiate( id, this );
|
||||
return persister.instantiate( id, this );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue