## org.hibernate.ejb.metamodel
Class AttributeFactory

    java.lang.Object
      org.hibernate.ejb.metamodel.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`

Author:
  Steve Ebersole, Emmanuel Bernard

Constructor Summary
`AttributeFactory(org.hibernate.ejb.metamodel.MetadataContext context)`

Method Summary

`protected

`<Y> Class<Y>`

`

`accountForPrimitiveTypes(Class<Y> declaredType)`

`

`<X,Y> AttributeImplementor<X,Y>`

`

`buildAttribute(AbstractManagedType<X> ownerType, Property property)`
Build a normal attribute.

`

`<X,Y> SingularAttributeImpl<X,Y>`

`

`buildIdAttribute(AbstractIdentifiableType<X> ownerType, Property property)`
Build the identifier attribute descriptor

`

`<X,Y> SingularAttributeImpl<X,Y>`

`

`buildVersionAttribute(AbstractIdentifiableType<X> ownerType, Property property)`
Build the version attribute descriptor

`static javax.persistence.metamodel.PluralAttribute.CollectionType` `determineCollectionType(Class javaType)`
`static javax.persistence.metamodel.Attribute.PersistentAttributeType` `determineSingularAssociationAttributeType(Member member)`
`static ParameterizedType` `getSignatureType(Member member)`
`static boolean` `isManyToMany(Member member)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### AttributeFactory

    public AttributeFactory(org.hibernate.ejb.metamodel.MetadataContext context)

Method Detail

### buildAttribute

    public <X,Y> AttributeImplementor<X,Y> buildAttribute(AbstractManagedType<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)

### buildIdAttribute

    public <X,Y> SingularAttributeImpl<X,Y> buildIdAttribute(AbstractIdentifiableType<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(AbstractIdentifiableType<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

### determineSingularAssociationAttributeType

    public static javax.persistence.metamodel.Attribute.PersistentAttributeType determineSingularAssociationAttributeType(Member member)

### accountForPrimitiveTypes

    protected <Y> Class<Y> accountForPrimitiveTypes(Class<Y> declaredType)

### getSignatureType

    public static ParameterizedType getSignatureType(Member member)

### determineCollectionType

    public static javax.persistence.metamodel.PluralAttribute.CollectionType determineCollectionType(Class javaType)

### isManyToMany

    public static boolean isManyToMany(Member member)

Copyright © 2001-2010 Red Hat, Inc. All Rights Reserved.