本文整理汇总了Java中org.hibernate.property.Setter类的典型用法代码示例。如果您正苦于以下问题:Java Setter类的具体用法?Java Setter怎么用?Java Setter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Setter类属于org.hibernate.property包,在下文中一共展示了Setter类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: initialize
import org.hibernate.property.Setter; //导入依赖的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: buildProxyFactory
import org.hibernate.property.Setter; //导入依赖的package包/类
@Override
protected ProxyFactory buildProxyFactory(PersistentClass mappingInfo, Getter idGetter, Setter idSetter) {
ProxyFactory pf = new MapProxyFactory();
try {
//TODO: design new lifecycle for ProxyFactory
pf.postInstantiate(
getEntityName(),
null,
null,
null,
null,
null
);
}
catch ( HibernateException he ) {
LOG.unableToCreateProxyFactory( getEntityName(), he );
pf = null;
}
return pf;
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:22,代码来源:DynamicMapEntityTuplizer.java
示例3: AbstractComponentTuplizer
import org.hibernate.property.Setter; //导入依赖的package包/类
protected AbstractComponentTuplizer(Component component) {
propertySpan = component.getPropertySpan();
getters = new Getter[propertySpan];
setters = new Setter[propertySpan];
Iterator iter = component.getPropertyIterator();
boolean foundCustomAccessor=false;
int i = 0;
while ( iter.hasNext() ) {
Property prop = ( Property ) iter.next();
getters[i] = buildGetter( component, prop );
setters[i] = buildSetter( component, prop );
if ( !prop.isBasicPropertyAccessor() ) {
foundCustomAccessor = true;
}
i++;
}
hasCustomAccessors = foundCustomAccessor;
instantiator = buildInstantiator( component );
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:21,代码来源:AbstractComponentTuplizer.java
示例4: buildProxyFactory
import org.hibernate.property.Setter; //导入依赖的package包/类
protected ProxyFactory buildProxyFactory(PersistentClass mappingInfo, Getter idGetter, Setter idSetter) {
ProxyFactory pf = new MapProxyFactory();
try {
//TODO: design new lifecycle for ProxyFactory
pf.postInstantiate(
getEntityName(),
null,
null,
null,
null,
null
);
}
catch ( HibernateException he ) {
log.warn( "could not create proxy factory for:" + getEntityName(), he );
pf = null;
}
return pf;
}
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:21,代码来源:DynamicMapEntityTuplizer.java
示例5: buildProxyFactory
import org.hibernate.property.Setter; //导入依赖的package包/类
protected ProxyFactory buildProxyFactory(PersistentClass mappingInfo, Getter idGetter, Setter idSetter) {
HashSet proxyInterfaces = new HashSet();
proxyInterfaces.add( HibernateProxy.class );
proxyInterfaces.add( Element.class );
ProxyFactory pf = new Dom4jProxyFactory();
try {
pf.postInstantiate(
getEntityName(),
Element.class,
proxyInterfaces,
null,
null,
mappingInfo.hasEmbeddedIdentifier() ?
(AbstractComponentType) mappingInfo.getIdentifier().getType() :
null
);
}
catch ( HibernateException he ) {
log.warn( "could not create proxy factory for:" + getEntityName(), he );
pf = null;
}
return pf;
}
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:25,代码来源:Dom4jEntityTuplizer.java
示例6: testCompanyElementGeneration
import org.hibernate.property.Setter; //导入依赖的package包/类
public void testCompanyElementGeneration() throws Throwable {
Setter idSetter = PropertyAccessorFactory.getPropertyAccessor( generateIdProperty(), EntityMode.DOM4J )
.getSetter( null, null );
Setter nameSetter = PropertyAccessorFactory.getPropertyAccessor( generateNameProperty(), EntityMode.DOM4J )
.getSetter( null, null );
Setter textSetter = PropertyAccessorFactory.getPropertyAccessor( generateTextProperty(), EntityMode.DOM4J )
.getSetter( null, null );
Setter accountIdSetter = PropertyAccessorFactory.getPropertyAccessor(
generateAccountIdProperty(), EntityMode.DOM4J
)
.getSetter( null, null );
Element root = generateRootTestElement();
idSetter.set( root, new Long( 123 ), getSFI() );
textSetter.set( root, "description...", getSFI() );
nameSetter.set( root, "JBoss", getSFI() );
accountIdSetter.set( root, new Long( 456 ), getSFI() );
assertTrue( "DOMs not equal", new NodeComparator().compare( DOM, root ) == 0 );
}
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:22,代码来源:Dom4jAccessorTest.java
示例7: ValueGenerationPlan
import org.hibernate.property.Setter; //导入依赖的package包/类
public ValueGenerationPlan(
String propertyName,
IdentifierGenerator subGenerator,
Setter injector) {
this.propertyName = propertyName;
this.subGenerator = subGenerator;
this.injector = injector;
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:9,代码来源:Component.java
示例8: buildProxyFactory
import org.hibernate.property.Setter; //导入依赖的package包/类
@Override
protected ProxyFactory buildProxyFactory(PersistentClass thePersistentClass, Getter idGetter,
Setter idSetter) {
ProxyFactory pf = new MapProxyFactory();
try {
pf.postInstantiate(getEntityName(), null, null, null, null, null);
} catch (final HibernateException he) {
log.warn("could not create proxy factory for:" + getEntityName(), he);
pf = null;
}
return pf;
}
开发者ID:mauyr,项目名称:openbravo-brazil,代码行数:13,代码来源:OBDynamicTuplizer.java
示例9: AbstractComponentTuplizer
import org.hibernate.property.Setter; //导入依赖的package包/类
protected AbstractComponentTuplizer(Component component) {
propertySpan = component.getPropertySpan();
getters = new Getter[propertySpan];
setters = new Setter[propertySpan];
Iterator iter = component.getPropertyIterator();
boolean foundCustomAccessor=false;
int i = 0;
while ( iter.hasNext() ) {
Property prop = ( Property ) iter.next();
getters[i] = buildGetter( component, prop );
setters[i] = buildSetter( component, prop );
if ( !prop.isBasicPropertyAccessor() ) {
foundCustomAccessor = true;
}
i++;
}
hasCustomAccessors = foundCustomAccessor;
String[] getterNames = new String[propertySpan];
String[] setterNames = new String[propertySpan];
Class[] propTypes = new Class[propertySpan];
for ( int j = 0; j < propertySpan; j++ ) {
getterNames[j] = getters[j].getMethodName();
setterNames[j] = setters[j].getMethodName();
propTypes[j] = getters[j].getReturnType();
}
instantiator = buildInstantiator( component );
}
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:30,代码来源:AbstractComponentTuplizer.java
示例10: buildProxyFactory
import org.hibernate.property.Setter; //导入依赖的package包/类
protected ProxyFactory buildProxyFactory(PersistentClass persistentClass, Getter idGetter, Setter idSetter) {
// allows defining a custom proxy factory, which is responsible for
// generating lazy proxies for a given entity.
//
// Here we simply use the default...
return super.buildProxyFactory( persistentClass, idGetter, idSetter );
}
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:8,代码来源:MyEntityTuplizer.java
示例11: buildProxyFactory
import org.hibernate.property.Setter; //导入依赖的package包/类
@Override
protected ProxyFactory buildProxyFactory(PersistentClass pc, Getter arg1,Setter arg2) {
CFCHibernateProxyFactory pf = new CFCHibernateProxyFactory();
pf.postInstantiate(pc);
return pf;
}
开发者ID:lucee,项目名称:Lucee4,代码行数:8,代码来源:AbstractEntityTuplizerImpl.java
示例12: buildProxyFactory
import org.hibernate.property.Setter; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected ProxyFactory buildProxyFactory(PersistentClass persistentClass,
Getter idGetter, Setter idSetter) {
fixPropertyAccessors(persistentClass);
return super.buildProxyFactory(persistentClass, idGetter, idSetter);
}
开发者ID:jspresso,项目名称:jspresso-ce,代码行数:10,代码来源:DynamicPojoEntityTuplizer.java
示例13: buildPropertySetter
import org.hibernate.property.Setter; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected Setter buildPropertySetter(Property mappedProperty,
PersistentClass mappedEntity) {
return new EntityPropertyAccessor().getSetter(
mappedEntity.getMappedClass(), mappedProperty.getName());
}
开发者ID:jspresso,项目名称:jspresso-ce,代码行数:10,代码来源:DynamicPojoEntityTuplizer.java
示例14: resetNestedSetter
import org.hibernate.property.Setter; //导入依赖的package包/类
/**
* Comunica que se ha cambiado de bean, para que los {@link NestedSetter},
* creen una nueva instancia en vez de reutilizarla actual.
*/
private void resetNestedSetter() {
NestedObjectHolder noh = new NestedObjectHolder();
for (Setter s : setters) {
if (s instanceof NestedSetter) {
NestedSetter nSetter = (NestedSetter) s;
nSetter.setHolder(noh);
}
}
}
开发者ID:fpuna-cia,项目名称:karaku,代码行数:15,代码来源:KarakuAliasToBeanTransformer.java
示例15: handleDuplicate
import org.hibernate.property.Setter; //导入依赖的package包/类
/**
*
* @param primary
* @param duplicated
* @param currentAlias
*/
private void handleDuplicate(Object primary, Object duplicated) {
for (Setter s : setters) {
if (s instanceof NestedSetter) {
NestedSetter ns = (NestedSetter) s;
ns.join(primary, duplicated);
}
}
}
开发者ID:fpuna-cia,项目名称:karaku,代码行数:16,代码来源:KarakuAliasToBeanTransformer.java
示例16: initialize
import org.hibernate.property.Setter; //导入依赖的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
示例17: buildPropertySetter
import org.hibernate.property.Setter; //导入依赖的package包/类
@Override
protected Setter buildPropertySetter(Property mappedProperty, PersistentClass mappedEntity) {
if (!"property".equals(mappedProperty.getPropertyAccessorName())) {
mappedProperty.setPropertyAccessorName(OptionAwareDirectPropertyAccessor.class.getName());
}
return super.buildPropertySetter(mappedProperty, mappedEntity);
}
开发者ID:solita,项目名称:query-utils,代码行数:8,代码来源:OptionAwarePojoEntityTuplizer.java
示例18: getSetter
import org.hibernate.property.Setter; //导入依赖的package包/类
@Override
public Setter getSetter(final Class theClass, final String propertyName) throws PropertyNotFoundException {
final Field field = find(OptionAwareDirectPropertyAccessor_.fieldName.andThen(equalTo(propertyName)), fields(theClass)).get();
final boolean isOption = Option.class.isAssignableFrom(field.getType());
return new Setter() {
@Override
public void set(Object target, Object value, SessionFactoryImplementor factory) throws HibernateException {
try {
field.setAccessible(true);
field.set(target, isOption ? Option.of(value) : value);
}
catch (Exception e) {
throw new PropertyAccessException(e, "could not set a field value by reflection", true, theClass, propertyName);
}
}
@Override
public String getMethodName() {
return null;
}
@Override
public Method getMethod() {
return null;
}
};
}
开发者ID:solita,项目名称:query-utils,代码行数:28,代码来源:OptionAwareDirectPropertyAccessor.java
示例19: createSetter
import org.hibernate.property.Setter; //导入依赖的package包/类
/**
* @param theClass Target class in which the value is to be set
* @param propertyName Target property name
* @return returns Setter class instance
*/
private static Setter createSetter(Class theClass, String propertyName) {
CollectionPropertySetter result = getSetterOrNull(theClass, propertyName);
if (result == null) {
throw new PropertyNotFoundException(
"Could not find a setter for property "
+ propertyName
+ " in class "
+ theClass.getName());
}
return result;
}
开发者ID:NCIP,项目名称:iso21090,代码行数:17,代码来源:CollectionPropertyAccessor.java
示例20: injector
import org.hibernate.property.Setter; //导入依赖的package包/类
private Setter injector(Property property, Class attributeDeclarer) {
return property.getPropertyAccessor( attributeDeclarer )
.getSetter( attributeDeclarer, property.getName() );
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:Component.java
注:本文中的org.hibernate.property.Setter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论