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


Java Component.getPropertyIterator方法代码示例

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


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

示例1: AbstractComponentTuplizer

import org.hibernate.mapping.Component; //导入方法依赖的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

示例2: ComponentMetamodel

import org.hibernate.mapping.Component; //导入方法依赖的package包/类
public ComponentMetamodel(Component component) {
//		this.sessionFactory = sessionFactory;
		this.role = component.getRoleName();
		this.isKey = component.isKey();
		propertySpan = component.getPropertySpan();
		properties = new StandardProperty[propertySpan];
		Iterator itr = component.getPropertyIterator();
		int i = 0;
		while ( itr.hasNext() ) {
			Property property = ( Property ) itr.next();
			properties[i] = PropertyFactory.buildStandardProperty( property, false );
			propertyIndexes.put( property.getName(), i );
			i++;
		}

		entityMode = component.hasPojoRepresentation() ? EntityMode.POJO : EntityMode.MAP;

		// todo : move this to SF per HHH-3517; also see HHH-1907 and ComponentMetamodel
		final ComponentTuplizerFactory componentTuplizerFactory = new ComponentTuplizerFactory();
		final String tuplizerClassName = component.getTuplizerImplClassName( entityMode );
		this.componentTuplizer = tuplizerClassName == null ? componentTuplizerFactory.constructDefaultTuplizer(
				entityMode,
				component
		) : componentTuplizerFactory.constructTuplizer( tuplizerClassName, component );
	}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:26,代码来源:ComponentMetamodel.java

示例3: ComponentMetamodel

import org.hibernate.mapping.Component; //导入方法依赖的package包/类
public ComponentMetamodel(Component component) {
//		this.sessionFactory = sessionFactory;
		this.role = component.getRoleName();
		this.isKey = component.isKey();
		propertySpan = component.getPropertySpan();
		properties = new StandardProperty[propertySpan];
		Iterator itr = component.getPropertyIterator();
		int i = 0;
		while ( itr.hasNext() ) {
			Property property = ( Property ) itr.next();
			properties[i] = PropertyFactory.buildStandardProperty( property, false );
			propertyIndexes.put( property.getName(), new Integer( i ) );
			i++;
		}

		tuplizerMapping = new ComponentEntityModeToTuplizerMapping( component );
	}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:18,代码来源:ComponentMetamodel.java

示例4: getNestedInnerComponentNames

import org.hibernate.mapping.Component; //导入方法依赖的package包/类
public List<String> getNestedInnerComponentNames(String parentClassname, String topLevelComponentName,
    String nestedComponentName, String innerComponentNamePrefix) {
    List<String> names = new ArrayList<String>();
    PersistentClass parent = configuration.getClassMapping(parentClassname);
    Property topLevelProperty = parent.getProperty(topLevelComponentName);
    Component topLevelComponent = (Component) topLevelProperty.getValue();
    Property nestedProperty = topLevelComponent.getProperty(nestedComponentName);
    Set nestedSet = (Set) nestedProperty.getValue();
    Component nestedComponent = (Component) nestedSet.getElement();
    Iterator<?> propertyIter = nestedComponent.getPropertyIterator();
    while (propertyIter.hasNext()) {
        Property prop = (Property) propertyIter.next();
        if (prop.getName().startsWith(innerComponentNamePrefix)) {
            names.add(prop.getName());
        }
    }
    return names;
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:19,代码来源:HibernateConfigTypesInformationResolver.java

示例5: internalInitSubclassPropertyAliasesMap

import org.hibernate.mapping.Component; //导入方法依赖的package包/类
private void internalInitSubclassPropertyAliasesMap(String path, Iterator propertyIterator) {
	while ( propertyIterator.hasNext() ) {

		Property prop = ( Property ) propertyIterator.next();
		String propname = path == null ? prop.getName() : path + "." + prop.getName();
		if ( prop.isComposite() ) {
			Component component = ( Component ) prop.getValue();
			Iterator compProps = component.getPropertyIterator();
			internalInitSubclassPropertyAliasesMap( propname, compProps );
		}
		else {
			String[] aliases = new String[prop.getColumnSpan()];
			String[] cols = new String[prop.getColumnSpan()];
			Iterator colIter = prop.getColumnIterator();
			int l = 0;
			while ( colIter.hasNext() ) {
				Selectable thing = ( Selectable ) colIter.next();
				aliases[l] = thing.getAlias( getFactory().getDialect(), prop.getValue().getTable() );
				cols[l] = thing.getText( getFactory().getDialect() ); // TODO: skip formulas?
				l++;
			}

			subclassPropertyAliases.put( propname, aliases );
			subclassPropertyColumnNames.put( propname, cols );
		}
	}

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

示例6: interpretPartialCompositeValueGeneration

import org.hibernate.mapping.Component; //导入方法依赖的package包/类
private static void interpretPartialCompositeValueGeneration(
		SessionFactoryImplementor sessionFactory,
		Component composite,
		CompositeGenerationStrategyPairBuilder builder) {
	Iterator subProperties = composite.getPropertyIterator();
	while ( subProperties.hasNext() ) {
		final Property subProperty = (Property) subProperties.next();
		builder.addPair( buildGenerationStrategyPair( sessionFactory, subProperty ) );
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:11,代码来源:EntityMetamodel.java

示例7: hasPartialInsertComponentGeneration

import org.hibernate.mapping.Component; //导入方法依赖的package包/类
private boolean hasPartialInsertComponentGeneration(Component component) {
	Iterator subProperties = component.getPropertyIterator();
	while ( subProperties.hasNext() ) {
		final Property prop = ( Property ) subProperties.next();
		if ( isInsertGenerated( prop ) ) {
			return true;
		}
		else if ( prop.getValue() instanceof Component ) {
			if ( hasPartialInsertComponentGeneration( (Component) prop.getValue() ) ) {
				return true;
			}
		}
	}
	return false;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:16,代码来源:EntityMetamodel.java

示例8: hasPartialUpdateComponentGeneration

import org.hibernate.mapping.Component; //导入方法依赖的package包/类
private boolean hasPartialUpdateComponentGeneration(Component component) {
	Iterator subProperties = component.getPropertyIterator();
	while ( subProperties.hasNext() ) {
		Property prop = (Property) subProperties.next();
		if ( isUpdateGenerated( prop ) ) {
			return true;
		}
		else if ( prop.getValue() instanceof Component ) {
			if ( hasPartialUpdateComponentGeneration( ( Component ) prop.getValue() ) ) {
				return true;
			}
		}
	}
	return false;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:16,代码来源:EntityMetamodel.java

示例9: hasPartialInsertComponentGeneration

import org.hibernate.mapping.Component; //导入方法依赖的package包/类
private boolean hasPartialInsertComponentGeneration(Component component) {
	Iterator subProperties = component.getPropertyIterator();
	while ( subProperties.hasNext() ) {
		Property prop = ( Property ) subProperties.next();
		if ( prop.getGeneration() == PropertyGeneration.ALWAYS || prop.getGeneration() == PropertyGeneration.INSERT ) {
			return true;
		}
		else if ( prop.getValue() instanceof Component ) {
			if ( hasPartialInsertComponentGeneration( ( Component ) prop.getValue() ) ) {
				return true;
			}
		}
	}
	return false;
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:16,代码来源:EntityMetamodel.java

示例10: hasPartialUpdateComponentGeneration

import org.hibernate.mapping.Component; //导入方法依赖的package包/类
private boolean hasPartialUpdateComponentGeneration(Component component) {
	Iterator subProperties = component.getPropertyIterator();
	while ( subProperties.hasNext() ) {
		Property prop = ( Property ) subProperties.next();
		if ( prop.getGeneration() == PropertyGeneration.ALWAYS ) {
			return true;
		}
		else if ( prop.getValue() instanceof Component ) {
			if ( hasPartialUpdateComponentGeneration( ( Component ) prop.getValue() ) ) {
				return true;
			}
		}
	}
	return false;
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:16,代码来源:EntityMetamodel.java

示例11: AbstractComponentTuplizer

import org.hibernate.mapping.Component; //导入方法依赖的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

示例12: afterInitialization

import org.hibernate.mapping.Component; //导入方法依赖的package包/类
@Override
public void afterInitialization(
		Component embeddableBinding,
		PersisterCreationContext creationContext) {
	final Iterator<Property> mappingPropertyItr = embeddableBinding.getPropertyIterator();
	while ( mappingPropertyItr.hasNext() ) {
		final Property mappingProperty = mappingPropertyItr.next();

		// todo : Columns
		final List<Column> columns = Collections.emptyList();

		final OrmAttribute attribute = PersisterHelper.INSTANCE.buildAttribute(
				creationContext,
				this,
				embeddableBinding,
				mappingProperty.getName(),
				OrmTypeHelper.convert(
						creationContext,
						this,
						locaName,
						mappingProperty.getValue(),
						creationContext.getTypeConfiguration()
				),
				columns
		);
		addAttribute( attribute );

	}
}
 
开发者ID:hibernate,项目名称:hibernate-semantic-query,代码行数:30,代码来源:EmbeddableMapperImpl.java

示例13: getInnerComponentNames

import org.hibernate.mapping.Component; //导入方法依赖的package包/类
public List<String> getInnerComponentNames(String parentClassname, String topLevelComponentName,
    String innerComponentNamePrefix) {
    List<String> names = new ArrayList<String>();
    PersistentClass parent = configuration.getClassMapping(parentClassname);
    Property topLevel = parent.getProperty(topLevelComponentName);
    Component topLevelComponent = (Component) topLevel.getValue();
    Iterator<?> propertyIter = topLevelComponent.getPropertyIterator();
    while (propertyIter.hasNext()) {
        Property prop = (Property) propertyIter.next();
        if (prop.getName().startsWith(innerComponentNamePrefix)) {
            names.add(prop.getName());
        }
    }
    return names;
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:16,代码来源:HibernateConfigTypesInformationResolver.java

示例14: buildPair

import org.hibernate.mapping.Component; //导入方法依赖的package包/类
public GenerationStrategyPair buildPair() {
	if ( hadInMemoryGeneration && hadInDatabaseGeneration ) {
		throw new ValueGenerationStrategyException(
				"Composite attribute [" + mappingProperty.getName() + "] contained both in-memory"
						+ " and in-database value generation"
		);
	}
	else if ( hadInMemoryGeneration ) {
		throw new NotYetImplementedException( "Still need to wire in composite in-memory value generation" );

	}
	else if ( hadInDatabaseGeneration ) {
		final Component composite = (Component) mappingProperty.getValue();

		// we need the numbers to match up so we can properly handle 'referenced sql column values'
		if ( inDatabaseStrategies.size() != composite.getPropertySpan() ) {
			throw new ValueGenerationStrategyException(
					"Internal error : mismatch between number of collected in-db generation strategies" +
							" and number of attributes for composite attribute : " + mappingProperty.getName()
			);
		}

		// the base-line values for the aggregated InDatabaseValueGenerationStrategy we will build here.
		GenerationTiming timing = GenerationTiming.INSERT;
		boolean referenceColumns = false;
		String[] columnValues = new String[ composite.getColumnSpan() ];

		// start building the aggregate values
		int propertyIndex = -1;
		int columnIndex = 0;
		Iterator subProperties = composite.getPropertyIterator();
		while ( subProperties.hasNext() ) {
			propertyIndex++;
			final Property subProperty = (Property) subProperties.next();
			final InDatabaseValueGenerationStrategy subStrategy = inDatabaseStrategies.get( propertyIndex );

			if ( subStrategy.getGenerationTiming() == GenerationTiming.ALWAYS ) {
				// override the base-line to the more often "ALWAYS"...
				timing = GenerationTiming.ALWAYS;

			}
			if ( subStrategy.referenceColumnsInSql() ) {
				// override base-line value
				referenceColumns = true;
			}
			if ( subStrategy.getReferencedColumnValues() != null ) {
				if ( subStrategy.getReferencedColumnValues().length != subProperty.getColumnSpan() ) {
					throw new ValueGenerationStrategyException(
							"Internal error : mismatch between number of collected 'referenced column values'" +
									" and number of columns for composite attribute : " + mappingProperty.getName() +
									'.' + subProperty.getName()
					);
				}
				System.arraycopy(
						subStrategy.getReferencedColumnValues(),
						0,
						columnValues,
						columnIndex,
						subProperty.getColumnSpan()
				);
			}
		}

		// then use the aggregated values to build the InDatabaseValueGenerationStrategy
		return new GenerationStrategyPair(
				new InDatabaseValueGenerationStrategyImpl( timing, referenceColumns, columnValues )
		);
	}
	else {
		return NO_GEN_PAIR;
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:73,代码来源:EntityMetamodel.java


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