org.hibernate.engine.SessionImplementor#internalLoad ( )源码实例Demo

下面列出了org.hibernate.engine.SessionImplementor#internalLoad ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: cacheonix-core   文件: AnyType.java
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 项目: cacheonix-core   文件: EntityType.java
/**
 * 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 项目: cacheonix-core   文件: AnyType.java
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 项目: cacheonix-core   文件: MultiplicityType.java
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 项目: cacheonix-core   文件: AnyType.java
private Object resolveAny(String entityName, Serializable id, SessionImplementor session)
throws HibernateException {
	return entityName==null || id==null ?
			null : session.internalLoad( entityName, id, false, false );
}