FileDocCategorySizeDatePackage
ComponentMetamodel.javaAPI DocHibernate 3.2.52761Thu Jul 13 19:09:20 BST 2006org.hibernate.tuple.component

ComponentMetamodel

public class ComponentMetamodel extends Object implements Serializable
Centralizes metamodel information about a component.
author
Steve Ebersole

Fields Summary
private final String
role
private final boolean
isKey
private final org.hibernate.tuple.StandardProperty[]
properties
private final ComponentEntityModeToTuplizerMapping
tuplizerMapping
private final int
propertySpan
private final Map
propertyIndexes
Constructors Summary
public ComponentMetamodel(org.hibernate.mapping.Component component)


//	public ComponentMetamodel(Component component, SessionFactoryImplementor sessionFactory) {
	   
//		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 );
	
Methods Summary
public org.hibernate.tuple.StandardProperty[]getProperties()

		return properties;
	
public org.hibernate.tuple.StandardPropertygetProperty(int index)

		if ( index < 0 || index >= propertySpan ) {
			throw new IllegalArgumentException( "illegal index value for component property access [request=" + index + ", span=" + propertySpan + "]" );
		}
		return properties[index];
	
public org.hibernate.tuple.StandardPropertygetProperty(java.lang.String propertyName)

		return getProperty( getPropertyIndex( propertyName ) );
	
public intgetPropertyIndex(java.lang.String propertyName)

		Integer index = ( Integer ) propertyIndexes.get( propertyName );
		if ( index == null ) {
			throw new HibernateException( "component does not contain such a property [" + propertyName + "]" );
		}
		return index.intValue();
	
public intgetPropertySpan()

		return propertySpan;
	
public ComponentEntityModeToTuplizerMappinggetTuplizerMapping()

		return tuplizerMapping;
	
public booleanisKey()

		return isKey;