public Member resolveMember(AttributeContext attributeContext) { final IdentifiableType identifiableType = (IdentifiableType) attributeContext.getOwnerType(); final EntityMetamodel entityMetamodel = getDeclarerEntityMetamodel( identifiableType ); final String versionPropertyName = attributeContext.getPropertyMapping().getName(); if ( ! versionPropertyName.equals( entityMetamodel.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(); } };
public Member resolveMember(AttributeContext attributeContext) { final IdentifiableType identifiableType = (IdentifiableType) attributeContext.getOwnerType(); final EntityMetamodel entityMetamodel = getDeclarerEntityMetamodel( identifiableType ); if ( ! attributeContext.getPropertyMapping().getName() .equals( entityMetamodel.getIdentifierProperty().getName() ) ) { // this *should* indicate processing part of an IdClass... return VIRTUAL_IDENTIFIER_MEMBER_RESOLVER.resolveMember( attributeContext ); } return entityMetamodel.getTuplizer().getIdentifierGetter().getMember(); } };
/** * {@inheritDoc} */ public Member resolveMember(AttributeContext attributeContext) { final IdentifiableType identifiableType = (IdentifiableType) attributeContext.getOwnerType(); final EntityMetamodel entityMetamodel = getDeclarerEntityMetamodel( identifiableType ); if ( ! entityMetamodel.getIdentifierProperty().isVirtual() ) { throw new IllegalArgumentException( "expecting IdClass mapping" ); } org.hibernate.type.Type type = entityMetamodel.getIdentifierProperty().getType(); if ( ! EmbeddedComponentType.class.isInstance( type ) ) { throw new IllegalArgumentException( "expecting IdClass mapping" ); } final EmbeddedComponentType componentType = (EmbeddedComponentType) type; final String attributeName = attributeContext.getPropertyMapping().getName(); return componentType.getComponentTuplizer() .getGetter( componentType.getPropertyIndex( attributeName ) ) .getMember(); } };
/** * {@inheritDoc} */ public Member resolveMember(AttributeContext attributeContext) { final EmbeddableTypeImpl embeddableType = ( EmbeddableTypeImpl<?> ) attributeContext.getOwnerType(); final String attributeName = attributeContext.getPropertyMapping().getName(); return embeddableType.getHibernateType() .getComponentTuplizer() .getGetter( embeddableType.getHibernateType().getPropertyIndex( attributeName ) ) .getMember(); } };
return entityMetamodel.getTuplizer() .getGetter( index ) .getMember();