本文整理汇总了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;
}
示例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
);
}
}
示例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;
}