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


Java Property.isLazy方法代码示例

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


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

示例1: PojoEntityTuplizer

import org.hibernate.mapping.Property; //导入方法依赖的package包/类
public PojoEntityTuplizer(EntityMetamodel entityMetamodel, PersistentClass mappedEntity) {
		super( entityMetamodel, mappedEntity );
		this.mappedClass = mappedEntity.getMappedClass();
		this.proxyInterface = mappedEntity.getProxyInterface();
		this.lifecycleImplementor = Lifecycle.class.isAssignableFrom( mappedClass );
		this.isInstrumented = entityMetamodel.isInstrumented();

		Iterator iter = mappedEntity.getPropertyClosureIterator();
		while ( iter.hasNext() ) {
			Property property = (Property) iter.next();
			if ( property.isLazy() ) {
				lazyPropertyNames.add( property.getName() );
			}
		}

		String[] getterNames = new String[propertySpan];
		String[] setterNames = new String[propertySpan];
		Class[] propTypes = new Class[propertySpan];
		for ( int i = 0; i < propertySpan; i++ ) {
			getterNames[i] = getters[i].getMethodName();
			setterNames[i] = setters[i].getMethodName();
			propTypes[i] = getters[i].getReturnType();
		}

		if ( hasCustomAccessors || !Environment.useReflectionOptimizer() ) {
			optimizer = null;
		}
		else {
			// todo : YUCK!!!
			optimizer = Environment.getBytecodeProvider().getReflectionOptimizer( mappedClass, getterNames, setterNames, propTypes );
//			optimizer = getFactory().getSettings().getBytecodeProvider().getReflectionOptimizer(
//					mappedClass, getterNames, setterNames, propTypes
//			);
		}

	}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:37,代码来源:PojoEntityTuplizer.java

示例2: buildVersionProperty

import org.hibernate.mapping.Property; //导入方法依赖的package包/类
/**
 * Generates a VersionProperty representation for an entity mapping given its
 * version mapping Property.
 *
 * @param property The version mapping Property.
 * @param lazyAvailable Is property lazy loading currently available.
 * @return The appropriate VersionProperty definition.
 */
public static VersionProperty buildVersionProperty(
		EntityPersister persister,
		SessionFactoryImplementor sessionFactory,
		int attributeNumber,
		Property property,
		boolean lazyAvailable) {
	String mappedUnsavedValue = ( (KeyValue) property.getValue() ).getNullValue();
	
	VersionValue unsavedValue = UnsavedValueFactory.getUnsavedVersionValue(
			mappedUnsavedValue,
			getGetter( property ),
			(VersionType) property.getType(),
			getConstructor( property.getPersistentClass() )
	);

	boolean lazy = lazyAvailable && property.isLazy();

	return new VersionProperty(
			persister,
			sessionFactory,
			attributeNumber,
	        property.getName(),
	        property.getValue().getType(),
			new BaselineAttributeInformation.Builder()
					.setLazy( lazy )
					.setInsertable( property.isInsertable() )
					.setUpdateable( property.isUpdateable() )
					.setValueGenerationStrategy( property.getValueGenerationStrategy() )
					.setNullable( property.isOptional() )
					.setDirtyCheckable( property.isUpdateable() && !lazy )
					.setVersionable( property.isOptimisticLocked() )
					.setCascadeStyle( property.getCascadeStyle() )
					.createInformation(),
	        unsavedValue
		);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:45,代码来源:PropertyFactory.java

示例3: buildStandardProperty

import org.hibernate.mapping.Property; //导入方法依赖的package包/类
@Deprecated
public static StandardProperty buildStandardProperty(Property property, boolean lazyAvailable) {
	final Type type = property.getValue().getType();

	// we need to dirty check collections, since they can cause an owner
	// version number increment

	// we need to dirty check many-to-ones with not-found="ignore" in order
	// to update the cache (not the database), since in this case a null
	// entity reference can lose information

	boolean alwaysDirtyCheck = type.isAssociationType() &&
			( (AssociationType) type ).isAlwaysDirtyChecked();

	return new StandardProperty(
			property.getName(),
			type,
			lazyAvailable && property.isLazy(),
			property.isInsertable(),
			property.isUpdateable(),
			property.getValueGenerationStrategy(),
			property.isOptional(),
			alwaysDirtyCheck || property.isUpdateable(),
			property.isOptimisticLocked(),
			property.getCascadeStyle(),
			property.getValue().getFetchMode()
	);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:29,代码来源:PropertyFactory.java

示例4: PojoEntityTuplizer

import org.hibernate.mapping.Property; //导入方法依赖的package包/类
public PojoEntityTuplizer(EntityMetamodel entityMetamodel, PersistentClass mappedEntity) {
		super( entityMetamodel, mappedEntity );
		this.mappedClass = mappedEntity.getMappedClass();
		this.proxyInterface = mappedEntity.getProxyInterface();
		this.lifecycleImplementor = Lifecycle.class.isAssignableFrom( mappedClass );
		this.validatableImplementor = Validatable.class.isAssignableFrom( mappedClass );

		Iterator iter = mappedEntity.getPropertyClosureIterator();
		while ( iter.hasNext() ) {
			Property property = (Property) iter.next();
			if ( property.isLazy() ) {
				lazyPropertyNames.add( property.getName() );
			}
		}

		String[] getterNames = new String[propertySpan];
		String[] setterNames = new String[propertySpan];
		Class[] propTypes = new Class[propertySpan];
		for ( int i = 0; i < propertySpan; i++ ) {
			getterNames[i] = getters[i].getMethodName();
			setterNames[i] = setters[i].getMethodName();
			propTypes[i] = getters[i].getReturnType();
		}

		if ( hasCustomAccessors || !Environment.useReflectionOptimizer() ) {
			optimizer = null;
		}
		else {
			// todo : YUCK!!!
			optimizer = Environment.getBytecodeProvider().getReflectionOptimizer( mappedClass, getterNames, setterNames, propTypes );
//			optimizer = getFactory().getSettings().getBytecodeProvider().getReflectionOptimizer(
//					mappedClass, getterNames, setterNames, propTypes
//			);
		}
	
	}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:37,代码来源:PojoEntityTuplizer.java

示例5: buildVersionProperty

import org.hibernate.mapping.Property; //导入方法依赖的package包/类
/**
 * Generates a VersionProperty representation for an entity mapping given its
 * version mapping Property.
 *
 * @param property The version mapping Property.
 * @param lazyAvailable Is property lazy loading currently available.
 * @return The appropriate VersionProperty definition.
 */
public static VersionProperty buildVersionProperty(Property property, boolean lazyAvailable) {
	String mappedUnsavedValue = ( (KeyValue) property.getValue() ).getNullValue();
	
	VersionValue unsavedValue = UnsavedValueFactory.getUnsavedVersionValue(
			mappedUnsavedValue, 
			getGetter( property ),
			(VersionType) property.getType(),
			getConstructor( property.getPersistentClass() )
		);

	boolean lazy = lazyAvailable && property.isLazy();

	return new VersionProperty(
	        property.getName(),
	        property.getNodeName(),
	        property.getValue().getType(),
	        lazy,
			property.isInsertable(),
			property.isUpdateable(),
	        property.getGeneration() == PropertyGeneration.INSERT || property.getGeneration() == PropertyGeneration.ALWAYS,
			property.getGeneration() == PropertyGeneration.ALWAYS,
			property.isOptional(),
			property.isUpdateable() && !lazy,
			property.isOptimisticLocked(),
	        property.getCascadeStyle(),
	        unsavedValue
		);
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:37,代码来源:PropertyFactory.java

示例6: buildStandardProperty

import org.hibernate.mapping.Property; //导入方法依赖的package包/类
/**
 * Generate a "standard" (i.e., non-identifier and non-version) based on the given
 * mapped property.
 *
 * @param property The mapped property.
 * @param lazyAvailable Is property lazy loading currently available.
 * @return The appropriate StandardProperty definition.
 */
public static StandardProperty buildStandardProperty(Property property, boolean lazyAvailable) {
	
	final Type type = property.getValue().getType();
	
	// we need to dirty check collections, since they can cause an owner
	// version number increment
	
	// we need to dirty check many-to-ones with not-found="ignore" in order 
	// to update the cache (not the database), since in this case a null
	// entity reference can lose information
	
	boolean alwaysDirtyCheck = type.isAssociationType() && 
			( (AssociationType) type ).isAlwaysDirtyChecked(); 

	return new StandardProperty(
			property.getName(),
			property.getNodeName(),
			type,
			lazyAvailable && property.isLazy(),
			property.isInsertable(),
			property.isUpdateable(),
	        property.getGeneration() == PropertyGeneration.INSERT || property.getGeneration() == PropertyGeneration.ALWAYS,
			property.getGeneration() == PropertyGeneration.ALWAYS,
			property.isOptional(),
			alwaysDirtyCheck || property.isUpdateable(),
			property.isOptimisticLocked(),
			property.getCascadeStyle(),
	        property.getValue().getFetchMode()
		);
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:39,代码来源:PropertyFactory.java


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