Class AttributeFactory

java.lang.Object
org.hibernate.metamodel.internal.AttributeFactory

public class AttributeFactory extends Object
A factory for building Attribute instances. Exposes 3 main services for building
  1. normal attributes
  2. id attributes
  3. version attributes
  • Constructor Details

  • Method Details

    • buildAttribute

      public <X, Y> PersistentAttribute<X,Y> buildAttribute(ManagedDomainType<X> ownerType, Property property)
      Build a normal attribute.
      Type Parameters:
      X - The type of the owner
      Y - The attribute type
      Parameters:
      ownerType - The descriptor of the attribute owner (aka declarer).
      property - The Hibernate property descriptor for the attribute
      Returns:
      The built attribute descriptor or null if the attribute is not part of the JPA 2 model (eg backrefs)
    • buildAttribute

      public static <X, Y> PersistentAttribute<X,Y> buildAttribute(ManagedDomainType<X> ownerType, Property property, MetadataContext metadataContext)
    • buildIdAttribute

      public <X, Y> SingularPersistentAttribute<X,Y> buildIdAttribute(IdentifiableDomainType<X> ownerType, Property property)
      Build the identifier attribute descriptor
      Type Parameters:
      X - The type of the owner
      Y - The attribute type
      Parameters:
      ownerType - The descriptor of the attribute owner (aka declarer).
      property - The Hibernate property descriptor for the identifier attribute
      Returns:
      The built attribute descriptor
    • buildVersionAttribute

      public <X, Y> SingularAttributeImpl<X,Y> buildVersionAttribute(IdentifiableDomainType<X> ownerType, Property property)
      Build the version attribute descriptor
      Type Parameters:
      X - The type of the owner
      Y - The attribute type
      Parameters:
      ownerType - The descriptor of the attribute owner (aka declarer).
      property - The Hibernate property descriptor for the version attribute
      Returns:
      The built attribute descriptor
    • determineSimpleType

      public static <Y> DomainType<Y> determineSimpleType(ValueContext typeContext, MetadataContext context)
    • determineSingularAssociationClassification

      public static AttributeClassification determineSingularAssociationClassification(Member member)
    • getSignatureType

      public static ParameterizedType getSignatureType(Member member)
    • isManyToMany

      public static boolean isManyToMany(Member member)