当前位置: 首页>>代码示例>>Java>>正文


Java EntityPersister.getPropertyType方法代码示例

本文整理汇总了Java中org.hibernate.persister.entity.EntityPersister.getPropertyType方法的典型用法代码示例。如果您正苦于以下问题:Java EntityPersister.getPropertyType方法的具体用法?Java EntityPersister.getPropertyType怎么用?Java EntityPersister.getPropertyType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.hibernate.persister.entity.EntityPersister的用法示例。


在下文中一共展示了EntityPersister.getPropertyType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: CachedNaturalId

import org.hibernate.persister.entity.EntityPersister; //导入方法依赖的package包/类
public CachedNaturalId(EntityPersister persister, Object[] values) {
	this.persister = persister;
	this.values = values;

	final int prime = 31;
	int hashCodeCalculation = 1;
	hashCodeCalculation = prime * hashCodeCalculation + persister.hashCode();

	final int[] naturalIdPropertyIndexes = persister.getNaturalIdentifierProperties();
	naturalIdTypes = new Type[ naturalIdPropertyIndexes.length ];
	int i = 0;
	for ( int naturalIdPropertyIndex : naturalIdPropertyIndexes ) {
		final Type type = persister.getPropertyType( persister.getPropertyNames()[ naturalIdPropertyIndex ] );
		naturalIdTypes[i] = type;
		final int elementHashCode = values[i] == null ? 0 :type.getHashCode( values[i], persister.getFactory() );
		hashCodeCalculation = prime * hashCodeCalculation + elementHashCode;
		i++;
	}

	this.hashCode = hashCodeCalculation;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:22,代码来源:NaturalIdXrefDelegate.java

示例2: getIdentifier

import org.hibernate.persister.entity.EntityPersister; //导入方法依赖的package包/类
protected final Object getIdentifier(Object value, SessionImplementor session) throws HibernateException {
	if ( isNotEmbedded(session) ) {
		return value;
	}

	if ( isReferenceToPrimaryKey() || uniqueKeyPropertyName == null ) {
		return ForeignKeys.getEntityIdentifierIfNotUnsaved( getAssociatedEntityName(), value, session ); //tolerates nulls
	}
	else if ( value == null ) {
		return null;
	}
	else {
		EntityPersister entityPersister = getAssociatedEntityPersister( session.getFactory() );
		Object propertyValue = entityPersister.getPropertyValue( value, uniqueKeyPropertyName );
		// We now have the value of the property-ref we reference.  However,
		// we need to dig a little deeper, as that property might also be
		// an entity type, in which case we need to resolve its identitifier
		Type type = entityPersister.getPropertyType( uniqueKeyPropertyName );
		if ( type.isEntityType() ) {
			propertyValue = ( ( EntityType ) type ).getIdentifier( propertyValue, session );
		}

		return propertyValue;
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:26,代码来源:EntityType.java

示例3: NaturalIdResolutionCache

import org.hibernate.persister.entity.EntityPersister; //导入方法依赖的package包/类
private NaturalIdResolutionCache(EntityPersister persister) {
	this.persister = persister;

	final int[] naturalIdPropertyIndexes = persister.getNaturalIdentifierProperties();
	naturalIdTypes = new Type[ naturalIdPropertyIndexes.length ];
	int i = 0;
	for ( int naturalIdPropertyIndex : naturalIdPropertyIndexes ) {
		naturalIdTypes[i++] = persister.getPropertyType( persister.getPropertyNames()[ naturalIdPropertyIndex ] );
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:11,代码来源:NaturalIdXrefDelegate.java


注:本文中的org.hibernate.persister.entity.EntityPersister.getPropertyType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。