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


Java PropertyAccessor.getSetter方法代码示例

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


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

示例1: initialize

import org.hibernate.property.PropertyAccessor; //导入方法依赖的package包/类
private void initialize(String[] aliases) {
	PropertyAccessor propertyAccessor = new ChainedPropertyAccessor(
			new PropertyAccessor[] {
					PropertyAccessorFactory.getPropertyAccessor( resultClass, null ),
					PropertyAccessorFactory.getPropertyAccessor( "field" )
			}
	);
	this.aliases = new String[ aliases.length ];
	setters = new Setter[ aliases.length ];
	for ( int i = 0; i < aliases.length; i++ ) {
		String alias = aliases[ i ];
		if ( alias != null ) {
			this.aliases[ i ] = alias;
			setters[ i ] = propertyAccessor.getSetter( resultClass, alias );
		}
	}
	isInitialized = true;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:19,代码来源:AliasToBeanResultTransformer.java

示例2: PojoComponentTuplizer

import org.hibernate.property.PropertyAccessor; //导入方法依赖的package包/类
public PojoComponentTuplizer(Component component) {
	super( component );

	this.componentClass = component.getComponentClass();

	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();
	}

	final String parentPropertyName = component.getParentProperty();
	if ( parentPropertyName == null ) {
		parentSetter = null;
		parentGetter = null;
	}
	else {
		PropertyAccessor pa = PropertyAccessorFactory.getPropertyAccessor( null );
		parentSetter = pa.getSetter( componentClass, parentPropertyName );
		parentGetter = pa.getGetter( componentClass, parentPropertyName );
	}

	if ( hasCustomAccessors || !Environment.useReflectionOptimizer() ) {
		optimizer = null;
	}
	else {
		// TODO: here is why we need to make bytecode provider global :(
		// TODO : again, fix this after HHH-1907 is complete
		optimizer = Environment.getBytecodeProvider().getReflectionOptimizer(
				componentClass, getterNames, setterNames, propTypes
		);
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:37,代码来源:PojoComponentTuplizer.java

示例3: initialize

import org.hibernate.property.PropertyAccessor; //导入方法依赖的package包/类
private void initialize(String[] newAlias) {

		PropertyAccessor propertyAccessor = new ChainedPropertyAccessor(
				new PropertyAccessor[] {
						PropertyAccessorFactory.getPropertyAccessor(
								resultClass, null),
						PropertyAccessorFactory.getPropertyAccessor("field") });
		this.aliases = new String[newAlias.length];
		setters = new Setter[newAlias.length];
		for (int i = 0; i < newAlias.length; i++) {
			String alias = newAlias[i];
			if (alias != null) {
				this.aliases[i] = alias;
				// Diferencia con AliasToBeanResultTransformer

				if (alias.indexOf('.') > 0) {
					// found nested
					setters[i] = new NestedSetter(resultClass, alias);
				} else {

					// -------------------------------------------
					setters[i] = propertyAccessor.getSetter(resultClass, alias);
					// Diferencia con AliasToBeanResultTransformer
				}
				// -------------------------------------------
			}
		}
		isInitialized = true;
	}
 
开发者ID:fpuna-cia,项目名称:karaku,代码行数:30,代码来源:KarakuAliasToBeanTransformer.java


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