Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Hibernate, Relational Persistence for Idiomatic Java
   *
   * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
   * third-party contributors as indicated by either @author tags or express
   * copyright attribution statements applied by the authors.  All
   * third-party contributions are distributed under license by Red Hat Inc.
   *
   * This copyrighted material is made available to anyone wishing to use, modify,
  * copy, or redistribute it subject to the terms and conditions of the GNU
  * Lesser General Public License, as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
  * for more details.
  *
  * You should have received a copy of the GNU Lesser General Public License
  * along with this distribution; if not, write to:
  * Free Software Foundation, Inc.
  * 51 Franklin Street, Fifth Floor
  * Boston, MA  02110-1301  USA
  */
 package org.hibernate.ejb.metamodel;
 
 
 
A factory for building javax.persistence.metamodel.Attribute instances. Exposes 3 main services for building
  1. normal attributes
  2. id attributes
  3. version attributes
    1. Author(s):
      Steve Ebersole
      Emmanuel Bernard
 
 public class AttributeFactory {
 
     private static final EntityManagerMessageLogger LOG = Logger.getMessageLogger(EntityManagerMessageLogger.class,
                                                                            AttributeFactory.class.getName());
 
 	private final MetadataContext context;
 
 	public AttributeFactory(MetadataContext context) {
 		this. = context;
 	}

Build a normal attribute.

Parameters:
ownerType The descriptor of the attribute owner (aka declarer).
property The Hibernate property descriptor for the attribute
<X> The type of the owner
<Y> The attribute type
Returns:
The built attribute descriptor or null if the attribute is not part of the JPA 2 model (eg backrefs)
 
 	@SuppressWarnings({ "unchecked" })
 	public <X, Y> AttributeImplementor<X, Y> buildAttribute(AbstractManagedType<X> ownerTypeProperty property) {
 		if ( property.isSynthetic() ) {
 			// hide synthetic/virtual properties (fabricated by Hibernate) from the JPA metamodel.
             .tracef(
 					"Skipping synthetic property %s(%s)",
 					ownerType.getJavaType().getName(),
 					property.getName()
 			);
 			return null;
 		}
         .trace("Building attribute [" + ownerType.getJavaType().getName() + "." + property.getName() + "]");
 		final AttributeContext<X> attributeContext = wrapownerTypeproperty );
 		final AttributeMetadata<X,Y> attributeMetadata =
        if (attributeMetadata == null) {
			return null;
		}
        if (attributeMetadata.isPlural()) {
			return buildPluralAttribute((PluralAttributeMetadata)attributeMetadata);
		}
        final SingularAttributeMetadata<X, Y> singularAttributeMetadata = (SingularAttributeMetadata<X, Y>)attributeMetadata;
        final Type<Y> metaModelType = getMetaModelType(singularAttributeMetadata.getValueContext());
        return new SingularAttributeImpl<X, Y>(
				attributeMetadata.getName(),
				attributeMetadata.getJavaType(),
				ownerType,
				attributeMetadata.getMember(),
				false,
				false,
				property.isOptional(),
				metaModelType,
				attributeMetadata.getPersistentAttributeType()
		);
	}
	private <X> AttributeContext<X> wrap(final AbstractManagedType<X> ownerTypefinal Property property) {
		return new AttributeContext<X>() {
				return ownerType;
			}
				return property;
			}
		};
	}

Build the identifier attribute descriptor

Parameters:
ownerType The descriptor of the attribute owner (aka declarer).
property The Hibernate property descriptor for the identifier attribute
<X> The type of the owner
<Y> The attribute type
Returns:
The built attribute descriptor
	@SuppressWarnings({ "unchecked" })
	public <X, Y> SingularAttributeImpl<X, Y> buildIdAttribute(AbstractIdentifiableType<X> ownerTypeProperty property) {
        .trace("Building identifier attribute [" + ownerType.getJavaType().getName() + "." + property.getName() + "]");
		final AttributeContext<X> attributeContext = wrapownerTypeproperty );
		final SingularAttributeMetadata<X,Y> attributeMetadata =
		final Type<Y> metaModelType = getMetaModelTypeattributeMetadata.getValueContext() );
				property.getName(),
				attributeMetadata.getJavaType(),
				ownerType,
				attributeMetadata.getMember(),
				metaModelType,
				attributeMetadata.getPersistentAttributeType()
		);
	}

Build the version attribute descriptor

Parameters:
ownerType The descriptor of the attribute owner (aka declarer).
property The Hibernate property descriptor for the version attribute
<X> The type of the owner
<Y> The attribute type
Returns:
The built attribute descriptor
	@SuppressWarnings({ "unchecked" })
	public <X, Y> SingularAttributeImpl<X, Y> buildVersionAttribute(AbstractIdentifiableType<X> ownerTypeProperty property) {
        .trace("Building version attribute [ownerType.getJavaType().getName()" + "." + "property.getName()]");
		final AttributeContext<X> attributeContext = wrapownerTypeproperty );
		final SingularAttributeMetadata<X,Y> attributeMetadata =
		final Type<Y> metaModelType = getMetaModelTypeattributeMetadata.getValueContext() );
				property.getName(),
				attributeMetadata.getJavaType(),
				ownerType,
				attributeMetadata.getMember(),
				metaModelType,
				attributeMetadata.getPersistentAttributeType()
		);
	}
	@SuppressWarnings"unchecked" )
	private <X, Y, E, K> AttributeImplementor<X, Y> buildPluralAttribute(PluralAttributeMetadata<X,Y,E> attributeMetadata) {
		final Type<E> elementType = getMetaModelTypeattributeMetadata.getElementValueContext() );
		if ( java.util.Map.class.isAssignableFromattributeMetadata.getJavaType() ) ) {
			final Type<K> keyType = getMetaModelTypeattributeMetadata.getMapKeyValueContext() );
			return PluralAttributeImpl.createattributeMetadata.getOwnerType(), elementTypeattributeMetadata.getJavaType(), keyType )
					.memberattributeMetadata.getMember() )
					.propertyattributeMetadata.getPropertyMapping() )
		}
        return PluralAttributeImpl.create(attributeMetadata.getOwnerType(), elementTypeattributeMetadata.getJavaType(), null).member(attributeMetadata.getMember()).property(attributeMetadata.getPropertyMapping()).persistentAttributeType(attributeMetadata.getPersistentAttributeType()).build();
	}
	@SuppressWarnings"unchecked" )
	private <Y> Type<Y> getMetaModelType(ValueContext typeContext) {
		switch ( typeContext.getValueClassification() ) {
			case : {
				return new BasicTypeImpl<Y>(
						typeContext.getBindableType(),
				);
			}
			case : {
				final org.hibernate.type.EntityType type = (EntityTypetypeContext.getValue().getType();
			}
			case : {
				final Component component = (ComponenttypeContext.getValue();
				final EmbeddableTypeImpl<Y> embeddableType = new EmbeddableTypeImpl<Y>(
						typeContext.getBindableType(),
						(ComponentTypetypeContext.getValue().getType()
				);
				.registerEmbeddedableTypeembeddableType );
				final Iterator<PropertysubProperties = component.getPropertyIterator();
				while ( subProperties.hasNext() ) {
					final Property property = subProperties.next();
					final AttributeImplementor<Y, Objectattribute = buildAttributeembeddableTypeproperty );
					if ( attribute != null ) {
						embeddableType.getBuilder().addAttributeattribute );
					}
				}
				embeddableType.lock();
				return embeddableType;
			}
			default: {
				throw new AssertionFailure"Unknown type : " + typeContext.getValueClassification() );
			}
		}
	}
		final Type.PersistenceType persistenceType = ownerType.getPersistenceType();
		if ( persistenceType == ..) {
		}
		else if ( persistenceType == ..) {
			PersistentClass persistentClass =
				.getEntityPersisterpersistentClass.getClassName() )
		}
		else {
			throw new AssertionFailure"Cannot get the metamodel for PersistenceType: " + persistenceType );
		}
	}

A contract for defining the meta information about a org.hibernate.mapping.Value
	private interface ValueContext {
Enum of the simplified types a value might be. These relate more to the Hibernate classification then the JPA classification
			EMBEDDABLE,
			ENTITY,
			BASIC
		}

Retrieve the value itself

Returns:
The value
		public Value getValue();
Retrieve the simplified value classification

Returns:
The value type
Retrieve the metadata about the attribute from which this value comes

Returns:
The "containing" attribute metadata.
	}

Basic contract for describing an attribute. The "description" is partially in terms of JPA (getPersistentAttributeType() and getOwnerType()), partially in terms of Hibernate (getPropertyMapping()) and partially just in terms of the java model itself (getName(), getMember() and getJavaType()).

Parameters:
<X> The attribute owner type
<Y> The attribute type.
	private interface AttributeMetadata<X,Y> {
Retrieve the name of the attribute

Returns:
The attribute name
		public String getName();

Retrieve the member defining the attribute

Returns:
The attribute member
		public Member getMember();

Retrieve the attribute java type.

Returns:
The java type of the attribute.
		public Class<Y> getJavaType();

Get the JPA attribute type classification for this attribute.

Returns:
The JPA attribute type classification
Retrieve the attribute owner's metamodel information

Returns:
The metamodel information for the attribute owner
Retrieve the Hibernate property mapping related to this attribute.

Returns:
The Hibernate property mapping
Is the attribute plural (a collection)?

Returns:
True if it is plural, false otherwise.
		public boolean isPlural();
	}

Attribute metadata contract for a non-plural attribute.

Parameters:
<X> The owner type
<Y> The attribute type
	private interface SingularAttributeMetadata<X,Y>  extends AttributeMetadata<X,Y> {
Retrieve the value context for this attribute

Returns:
The attributes value context
	}

Attribute metadata contract for a plural attribute.

Parameters:
<X> The owner type
<Y> The attribute type (the collection type)
<E> The collection element type
	private interface PluralAttributeMetadata<X,Y,E> extends AttributeMetadata<X,Y> {
Retrieve the JPA collection type classification for this attribute

Returns:
The JPA collection type classification
Retrieve the value context for the collection's elements.

Returns:
The value context for the collection's elements.
Retrieve the value context for the collection's keys (if a map, null otherwise).

Returns:
The value context for the collection's keys (if a map, null otherwise).
	}

Bundle's a Hibernate property mapping together with the JPA metamodel information of the attribute owner.

Parameters:
<X> The owner type.
	private interface AttributeContext<X> {
Retrieve the attribute owner.

Returns:
The owner.
Retrieve the Hibernate property mapping.

Returns:
The Hibvernate property mapping.
	}

Contract for how we resolve the java.lang.reflect.Member for a give attribute context.
	private interface MemberResolver {
		public Member resolveMember(AttributeContext attributeContext);
	}

Here is most of the nuts and bolts of this factory, where we interpret the known JPA metadata against the known Hibernate metadata and build a descriptor for the attribute.

Parameters:
attributeContext The attribute to be described
memberResolver Strategy for how to resolve the member defining the attribute.
<X> The owner type
<Y> The attribute type
Returns:
The attribute description
	@SuppressWarnings({ "unchecked" })
			AttributeContext<X> attributeContext,
			MemberResolver memberResolver) {
        .trace("Starting attribute metadata determination [" + attributeContext.getPropertyMapping().getName() + "]");
		final Member member = memberResolver.resolveMemberattributeContext );
        .trace("    Determined member [" + member + "]");
		final Value value = attributeContext.getPropertyMapping().getValue();
		final org.hibernate.type.Type type = value.getType();
        .trace("    Determined type [name=" + type.getName() + ", class=" + type.getClass().getName() + "]");
		if ( type.isAnyType() ) {
			// ANY mappings are currently not supported in the JPA metamodel; see HHH-6589
            if ( .isIgnoreUnsupported() ) {
                return null;
            }
			else {
                throw new UnsupportedOperationException"ANY not supported" );
            }
		}
		else if ( type.isAssociationType() ) {
			// collection or entity
			if ( type.isEntityType() ) {
				// entity
						attributeContext.getPropertyMapping(),
						attributeContext.getOwnerType(),
						member,
				);
			}
            // collection
            if (value instanceof Collection) {
                final Collection collValue = (Collection)value;
                final Value elementValue = collValue.getElement();
                final org.hibernate.type.Type elementType = elementValue.getType();
                // First, determine the type of the elements and use that to help determine the
                // collection type)
                final Attribute.PersistentAttributeType elementPersistentAttributeType;
                final Attribute.PersistentAttributeType persistentAttributeType;
                if (elementType.isAnyType()) {
                    throw new UnsupportedOperationException("collection of any not supported yet");
                }
                final boolean isManyToMany = isManyToMany(member);
                if (elementValue instanceof Component) {
                    elementPersistentAttributeType = ..;
                    persistentAttributeType = ..;
                } else if (elementType.isAssociationType()) {
                    elementPersistentAttributeType = isManyToMany ? .. : ..;
                    persistentAttributeType = elementPersistentAttributeType;
                } else {
                    elementPersistentAttributeType = ..;
                    persistentAttributeType = ..;
                }
                final Attribute.PersistentAttributeType keyPersistentAttributeType;
                // Finally, we determine the type of the map key (if needed)
                if (value instanceof Map) {
                    final Value keyValue = ((Map)value).getIndex();
                    final org.hibernate.type.Type keyType = keyValue.getType();
                    if (keyType.isAnyType()) throw new UnsupportedOperationException("collection of any not supported yet");
                    if (keyValue instanceof ComponentkeyPersistentAttributeType = ..;
                    else if (keyType.isAssociationType()) keyPersistentAttributeType = ..;
                    else keyPersistentAttributeType = ..;
                } else keyPersistentAttributeType = null;
                return new PluralAttributeMetadataImpl(attributeContext.getPropertyMapping(), attributeContext.getOwnerType(),
                                                       memberpersistentAttributeTypeelementPersistentAttributeType,
                                                       keyPersistentAttributeType);
            } else if (value instanceof OneToMany) {
                // TODO : is this even possible??? Really OneToMany should be describing the
                // element value within a o.h.mapping.Collection (see logic branch above)
                throw new IllegalArgumentException("HUH???");
//					final boolean isManyToMany = isManyToMany( member );
//					//one to many with FK => entity
//					return new PluralAttributeMetadataImpl(
//							attributeContext.getPropertyMapping(),
//							attributeContext.getOwnerType(),
//							member,
//							isManyToMany
//									? Attribute.PersistentAttributeType.MANY_TO_MANY
//									: Attribute.PersistentAttributeType.ONE_TO_MANY
//							value,
//							AttributeContext.TypeStatus.ENTITY,
//							Attribute.PersistentAttributeType.ONE_TO_MANY,
//							null, null, null
//					);
			}
		}
		else if ( attributeContext.getPropertyMapping().isComposite() ) {
			// component
					attributeContext.getPropertyMapping(),
					attributeContext.getOwnerType(),
					member,
			);
		}
		else {
			// basic type
					attributeContext.getPropertyMapping(),
					attributeContext.getOwnerType(),
					member,
			);
		}
		throw new UnsupportedOperationException"oops, we are missing something: " + attributeContext.getPropertyMapping() );
	}
		if ( Field.class.isInstancemember ) ) {
			return ( (Fieldmember ).getAnnotationOneToOne.class ) != null
		}
		else {
			return ( (Methodmember ).getAnnotationOneToOne.class ) != null
		}
	}
	private abstract class BaseAttributeMetadata<X,Y> implements AttributeMetadata<X,Y> {
		private final Property propertyMapping;
		private final AbstractManagedType<X> ownerType;
		private final Member member;
		private final Class<Y> javaType;
		@SuppressWarnings({ "unchecked" })
				Property propertyMapping,
				AbstractManagedType<X> ownerType,
				Member member,
				Attribute.PersistentAttributeType persistentAttributeType) {
			this. = propertyMapping;
			this. = ownerType;
			this. = member;
			this. = persistentAttributeType;
			final Class declaredType;
			// we can support method or field members here.  Is there really any other valid type?
			if ( Field.class.isInstancemember ) ) {
				declaredType = ( (Fieldmember ).getType();
			}
			else if ( Method.class.isInstancemember ) ) {
				declaredType = ( (Methodmember ).getReturnType();
			}
			else {
				throw new IllegalArgumentException"Cannot determine java-type from given member [" + member + "]" );
			}
			this. = accountForPrimitiveTypesdeclaredType );
		}
		public String getName() {
		}
		public Member getMember() {
			return ;
		}
		}
			return member.getDeclaringClass().getName() + '#' + member.getName();
		}
		public Class<Y> getJavaType() {
			return ;
		}
		}
			return ;
		}
		public boolean isPlural() {
		}
		}
	}
	@SuppressWarnings({ "unchecked" })
	protected <Y> Class<Y> accountForPrimitiveTypes(Class<Y> declaredType) {
//		if ( !declaredType.isPrimitive() ) {
//			return declaredType;
//		}
//
//		if ( Boolean.TYPE.equals( declaredType ) ) {
//			return (Class<Y>) Boolean.class;
//		}
//		if ( Character.TYPE.equals( declaredType ) ) {
//			return (Class<Y>) Character.class;
//		}
//		if( Byte.TYPE.equals( declaredType ) ) {
//			return (Class<Y>) Byte.class;
//		}
//		if ( Short.TYPE.equals( declaredType ) ) {
//			return (Class<Y>) Short.class;
//		}
//		if ( Integer.TYPE.equals( declaredType ) ) {
//			return (Class<Y>) Integer.class;
//		}
//		if ( Long.TYPE.equals( declaredType ) ) {
//			return (Class<Y>) Long.class;
//		}
//		if ( Float.TYPE.equals( declaredType ) ) {
//			return (Class<Y>) Float.class;
//		}
//		if ( Double.TYPE.equals( declaredType ) ) {
//			return (Class<Y>) Double.class;
//		}
//
//		throw new IllegalArgumentException( "Unexpected type [" + declaredType + "]" );
		// if the field is defined as int, return int not Integer...
		return declaredType;
	}
	private class SingularAttributeMetadataImpl<X,Y>
			implements SingularAttributeMetadata<X,Y> {
		private final ValueContext valueContext;
				Property propertyMapping,
				AbstractManagedType<X> ownerType,
				Member member,
				Attribute.PersistentAttributeType persistentAttributeType) {
			superpropertyMappingownerTypememberpersistentAttributeType );
				public Value getValue() {
				}
				public Class getBindableType() {
				}
					switch ( getPersistentAttributeType() ) {
						case : {
						}
						case : {
						}
						default: {
						}
					}
				}
				}
			};
		}
			return ;
		}
	}
	private class PluralAttributeMetadataImpl<X,Y,E>
			implements PluralAttributeMetadata<X,Y,E> {
		private final Class elementJavaType;
		private final Class keyJavaType;
		private final ValueContext keyValueContext;
				Property propertyMapping,
				AbstractManagedType<X> ownerType,
				Member member,
				Attribute.PersistentAttributeType persistentAttributeType,
				Attribute.PersistentAttributeType elementPersistentAttributeType,
				Attribute.PersistentAttributeType keyPersistentAttributeType) {
			superpropertyMappingownerTypememberpersistentAttributeType );
			this. = elementPersistentAttributeType;
			this. = keyPersistentAttributeType;
			ParameterizedType signatureType = getSignatureTypemember );
			if ( keyPersistentAttributeType == null ) {
				 = signatureType != null ?
						Object.class//FIXME and honor targetEntity?
				 = null;
			}
			else {
				 = signatureType != null ?
						Object.class//FIXME and honor targetEntity?
				 = signatureType != null ?
						Object.class//FIXME and honor targetEntity?
			}
				public Value getValue() {
				}
				public Class getBindableType() {
				}
						case : {
						}
						case : {
						}
						default: {
						}
					}
				}
				}
			};
			// interpret the key, if one
			if ( keyPersistentAttributeType != null ) {
				this. = new ValueContext() {
					public Value getValue() {
						return ( (MapgetPropertyMapping().getValue() ).getIndex();
					}
					public Class getBindableType() {
						return ;
					}
							case : {
							}
							case : {
							}
							default: {
							}
						}
					}
					}
				};
			}
			else {
			}
		}
			if ( type instanceof Class ) {
				return (Classtype;
			}
			else if ( type instanceof TypeVariable ) {
				final java.lang.reflect.Type upperBound = ( ( TypeVariable ) type ).getBounds()[0];
				return getClassFromGenericArgumentupperBound );
			}
			else if ( type instanceof ParameterizedType ) {
				final java.lang.reflect.Type rawType = ( (ParameterizedTypetype ).getRawType();
				return getClassFromGenericArgumentrawType );
			}
			else {
				throw new AssertionFailure(
						"Fail to process type argument in a generic declaration. Member : " + getMemberDescription()
" Type: " + type.getClass()
				);
			}
		}
		}
		}
		}
	}
	public static ParameterizedType getSignatureType(Member member) {
		final java.lang.reflect.Type type = Field.class.isInstancemember )
				? ( ( Field ) member ).getGenericType()
				: ( ( Method ) member ).getGenericReturnType();
		//this is a raw type
		if ( type instanceof Class ) return null;
		return (ParameterizedTypetype;
	}
		if ( java.util.List.class.isAssignableFromjavaType ) ) {
		}
		else if ( java.util.Set.class.isAssignableFromjavaType ) ) {
		}
		else if ( java.util.Map.class.isAssignableFromjavaType ) ) {
		}
		else if ( java.util.Collection.class.isAssignableFromjavaType ) ) {
		}
		else {
			throw new IllegalArgumentException"Expecting collection type [" + javaType.getName() + "]" );
		}
	}
	public static boolean isManyToMany(Member member) {
		return Field.class.isInstancemember )
				? ( (Fieldmember ).getAnnotationManyToMany.class ) != null
				: ( (Methodmember ).getAnnotationManyToMany.class ) != null;
	}
		public Member resolveMember(AttributeContext attributeContext) {
			final EmbeddableTypeImpl embeddableType = ( EmbeddableTypeImpl<?> ) attributeContext.getOwnerType();
			final String attributeName = attributeContext.getPropertyMapping().getName();
			return embeddableType.getHibernateType()
					.getGetterembeddableType.getHibernateType().getPropertyIndexattributeName ) )
		}
	};
		public Member resolveMember(AttributeContext attributeContext) {
			final IdentifiableType identifiableType = (IdentifiableTypeattributeContext.getOwnerType();
			final EntityMetamodel entityMetamodel = getDeclarerEntityMetamodelidentifiableType );
			if ( ! entityMetamodel.getIdentifierProperty().isVirtual() ) {
				throw new IllegalArgumentException"expecting IdClass mapping" );
			}
			org.hibernate.type.Type type = entityMetamodel.getIdentifierProperty().getType();
			if ( ! EmbeddedComponentType.class.isInstancetype ) ) {
				throw new IllegalArgumentException"expecting IdClass mapping" );
			}
			final EmbeddedComponentType componentType = (EmbeddedComponentTypetype;
			final String attributeName = attributeContext.getPropertyMapping().getName();
			return componentType.getComponentTuplizer()
					.getGettercomponentType.getPropertyIndexattributeName ) )
		}
	};

A java.lang.reflect.Member resolver for normal attributes.
		public Member resolveMember(AttributeContext attributeContext) {
			final AbstractManagedType ownerType = attributeContext.getOwnerType();
			final Property property = attributeContext.getPropertyMapping();
			final Type.PersistenceType persistenceType = ownerType.getPersistenceType();
			if ( .. == persistenceType ) {
				return .resolveMemberattributeContext );
			}
			else if ( .. == persistenceType
					|| .. == persistenceType ) {
				final IdentifiableType identifiableType = (IdentifiableTypeownerType;
				final EntityMetamodel entityMetamodel = getDeclarerEntityMetamodelidentifiableType );
				final String propertyName = property.getName();
				final Integer index = entityMetamodel.getPropertyIndexOrNullpropertyName );
				if ( index == null ) {
					// just like in #determineIdentifierJavaMember , this *should* indicate we have an IdClass mapping
				}
				else {
					return entityMetamodel.getTuplizer()
							.getGetterindex )
				}
			}
			else {
				throw new IllegalArgumentException"Unexpected owner type : " + persistenceType );
			}
		}
	};
		public Member resolveMember(AttributeContext attributeContext) {
			final IdentifiableType identifiableType = (IdentifiableTypeattributeContext.getOwnerType();
			final EntityMetamodel entityMetamodel = getDeclarerEntityMetamodelidentifiableType );
			if ( ! attributeContext.getPropertyMapping().getName()
					.equalsentityMetamodel.getIdentifierProperty().getName() ) ) {
				// this *should* indicate processing part of an IdClass...
			}
			return entityMetamodel.getTuplizer().getIdentifierGetter().getMember();
		}
	};
		public Member resolveMember(AttributeContext attributeContext) {
			final IdentifiableType identifiableType = (IdentifiableTypeattributeContext.getOwnerType();
			final EntityMetamodel entityMetamodel = getDeclarerEntityMetamodelidentifiableType );
			final String versionPropertyName = attributeContext.getPropertyMapping().getName();
			if ( ! versionPropertyName.equalsentityMetamodel.getVersionProperty().getName() ) ) {
				// this should never happen, but to be safe...
				throw new IllegalArgumentException"Given property did not match declared version property" );
			}
			return entityMetamodel.getTuplizer().getVersionGetter().getMember();
		}
	};