本文整理汇总了Java中org.hibernate.engine.SessionImplementor.internalLoad方法的典型用法代码示例。如果您正苦于以下问题:Java SessionImplementor.internalLoad方法的具体用法?Java SessionImplementor.internalLoad怎么用?Java SessionImplementor.internalLoad使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.hibernate.engine.SessionImplementor
的用法示例。
在下文中一共展示了SessionImplementor.internalLoad方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: replace
import org.hibernate.engine.SessionImplementor; //导入方法依赖的package包/类
public Object replace(
Object original,
Object target,
SessionImplementor session,
Object owner,
Map copyCache)
throws HibernateException {
if (original==null) {
return null;
}
else {
String entityName = session.bestGuessEntityName(original);
Serializable id = ForeignKeys.getEntityIdentifierIfNotUnsaved(
entityName,
original,
session
);
return session.internalLoad(
entityName,
id,
false,
false
);
}
}
示例2: resolveIdentifier
import org.hibernate.engine.SessionImplementor; //导入方法依赖的package包/类
/**
* Resolve an identifier via a load.
*
* @param id The entity id to resolve
* @param session The orginating session.
* @return The resolved identifier (i.e., loaded entity).
* @throws org.hibernate.HibernateException Indicates problems performing the load.
*/
protected final Object resolveIdentifier(Serializable id, SessionImplementor session) throws HibernateException {
boolean isProxyUnwrapEnabled = unwrapProxy &&
session.getFactory()
.getEntityPersister( getAssociatedEntityName() )
.isInstrumented( session.getEntityMode() );
Object proxyOrEntity = session.internalLoad(
getAssociatedEntityName(),
id,
eager,
isNullable() && !isProxyUnwrapEnabled
);
if ( proxyOrEntity instanceof HibernateProxy ) {
( ( HibernateProxy ) proxyOrEntity ).getHibernateLazyInitializer()
.setUnwrap( isProxyUnwrapEnabled );
}
return proxyOrEntity;
}
示例3: assemble
import org.hibernate.engine.SessionImplementor; //导入方法依赖的package包/类
public Object assemble(
Serializable cached,
SessionImplementor session,
Object owner)
throws HibernateException {
ObjectTypeCacheEntry e = (ObjectTypeCacheEntry) cached;
return e==null ? null : session.internalLoad(e.entityName, e.id, false, false);
}
示例4: assemble
import org.hibernate.engine.SessionImplementor; //导入方法依赖的package包/类
public Object assemble(
Serializable cached,
SessionImplementor session,
Object owner) throws HibernateException {
if (cached==null) return null;
Serializable[] o = (Serializable[]) cached;
Multiplicity m = new Multiplicity();
m.count = ( (Integer) o[0] ).intValue();
m.glarch = o[1]==null ?
null :
(GlarchProxy) session.internalLoad( Glarch.class.getName(), o[1], false, false );
return m;
}
示例5: resolveAny
import org.hibernate.engine.SessionImplementor; //导入方法依赖的package包/类
private Object resolveAny(String entityName, Serializable id, SessionImplementor session)
throws HibernateException {
return entityName==null || id==null ?
null : session.internalLoad( entityName, id, false, false );
}