本文整理汇总了Java中org.hibernate.property.Setter类的典型用法代码示例。如果您正苦于以下问题:Java Setter类的具体用法?Java Setter怎么用?Java Setter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Setter类属于org.hibernate.property包,在下文中一共展示了Setter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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 );
}
示例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;
}
示例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;
}
示例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 );
}
示例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;
}
示例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;
}
示例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 );
}
示例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 );
}
示例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;
}
示例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);
}
示例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());
}
示例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);
}
}
}
示例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);
}
}
}