Interface AttributeContainer

All Known Implementing Classes:
Component, Join, JoinedSubclass, PersistentClass, RootClass, SingleTableSubclass, Subclass, UnionSubclass

public interface AttributeContainer
Identifies a mapping model object which may have attributes (fields or properties). Abstracts over PersistentClass and Join.
API Note:
This model makes sense in hbm.xml mappings where a <property/> element may occur as a child of a <join/>. In annotations, and in orm.xml, a property cannot be said to itself belong to a secondary table, instead its columns are mapped to the table explicitly. In fact, the old hbm.xml model was more natural when it came to handling <column/> and especially <formula/> mappings in secondary tables. There was no need to repetitively write @Column(table="secondary"). Granted, it does sound strange to say that a Java property "belongs" to a secondary table.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Add an attribute to this PersistentClass or Join.
    boolean
    contains(Property property)
    Determine if the given attribute belongs to this container.
    getProperty(String propertyName)
    Get the attribute with the given name belonging to this container.
    The Table with the columns mapped by attributes belonging to this container.
  • Method Details

    • addProperty

      void addProperty(Property property)
      Add an attribute to this PersistentClass or Join.
    • contains

      boolean contains(Property property)
      Determine if the given attribute belongs to this container.
    • getProperty

      Property getProperty(String propertyName) throws MappingException
      Get the attribute with the given name belonging to this container.
      Parameters:
      propertyName - the name of an attribute
      Throws:
      MappingException - if there is no attribute with the given name
      Since:
      7.2
    • getTable

      Table getTable()
      The Table with the columns mapped by attributes belonging to this container.