/** * Build the version attribute descriptor * * @param ownerType The descriptor of the attribute owner (aka declarer). * @param property The Hibernate property descriptor for the version attribute * @param <X> The type of the owner * @param <Y> The attribute type * @return The built attribute descriptor */ @SuppressWarnings({"unchecked"}) public <X, Y> SingularAttributeImpl<X, Y> buildVersionAttribute( AbstractIdentifiableType<X> ownerType, Property property) { LOG.trace( "Building version attribute [ownerType.getJavaType().getName()" + "." + "property.getName()]"); final AttributeContext<X> attributeContext = wrap(ownerType, property); final SingularAttributeMetadata<X, Y> attributeMetadata = (SingularAttributeMetadata<X, Y>) determineAttributeMetadata(attributeContext, VERSION_MEMBER_RESOLVER); final Type<Y> metaModelType = getMetaModelType(attributeMetadata.getValueContext()); return new SingularAttributeImpl.Version( property.getName(), attributeMetadata.getJavaType(), ownerType, attributeMetadata.getMember(), metaModelType, attributeMetadata.getPersistentAttributeType()); }