Interface ClassMetadata

    • Method Detail

      • getEntityName

        String getEntityName()
        The name of the entity
      • getIdentifierPropertyName

        String getIdentifierPropertyName()
        Get the name of the identifier property (or return null)
      • getPropertyNames

        String[] getPropertyNames()
        Get the names of the class' persistent properties
      • getIdentifierType

        Type getIdentifierType()
        Get the identifier Hibernate type
      • getPropertyTypes

        Type[] getPropertyTypes()
        Get the Hibernate types of the class properties
      • hasProxy

        boolean hasProxy()
        Does this class support dynamic proxies?
      • isMutable

        boolean isMutable()
        Are instances of this class mutable?
      • isVersioned

        boolean isVersioned()
        Are instances of this class versioned by a timestamp or version number column?
      • getVersionProperty

        int getVersionProperty()
        Get the index of the version property
      • getPropertyNullability

        boolean[] getPropertyNullability()
        Get the nullability of the class' persistent properties
      • getPropertyLaziness

        boolean[] getPropertyLaziness()
        Get the "laziness" of the properties of this class
      • hasIdentifierProperty

        boolean hasIdentifierProperty()
        Does this class have an identifier property?
      • hasNaturalIdentifier

        boolean hasNaturalIdentifier()
        Does this entity declare a natural id?
      • getNaturalIdentifierProperties

        int[] getNaturalIdentifierProperties()
        Which properties hold the natural id?
      • hasSubclasses

        boolean hasSubclasses()
        Does this entity have mapped subclasses?
      • isInherited

        boolean isInherited()
        Does this entity extend a mapped superclass?
      • getMappedClass

        Class getMappedClass()
        The persistent class, or null
      • instantiate

        @Deprecated
        default Object instantiate​(Serializable id,
                                   SessionImplementor session)
        Deprecated.
        (since 5.3) Use the form accepting SharedSessionContractImplementor instead
        Create a class instance initialized with the given identifier
        Parameters:
        id - The identifier value to use (may be null to represent no value)
        session - The session from which the request originated.
        Returns:
        The instantiated entity.
      • instantiate

        Object instantiate​(Serializable id,
                           SharedSessionContractImplementor session)
        Create a class instance initialized with the given identifier
        Parameters:
        id - The identifier value to use (may be null to represent no value)
        session - The session from which the request originated.
        Returns:
        The instantiated entity.
      • getPropertyValues

        Object[] getPropertyValues​(Object entity)
                            throws HibernateException
        Extract the property values from the given entity.
        Parameters:
        entity - The entity from which to extract the property values.
        Returns:
        The property values.
        Throws:
        HibernateException
      • getIdentifier

        Serializable getIdentifier​(Object entity,
                                   SharedSessionContractImplementor session)
        Get the identifier of an instance (throw an exception if no identifier property)
        Parameters:
        entity - The entity for which to get the identifier
        session - The session from which the request originated
        Returns:
        The identifier
      • setIdentifier

        void setIdentifier​(Object entity,
                           Serializable id,
                           SharedSessionContractImplementor session)
        Inject the identifier value into the given entity.
        Parameters:
        entity - The entity to inject with the identifier value.
        id - The value to be injected as the identifier.
        session - The session from which is requests originates
      • implementsLifecycle

        boolean implementsLifecycle()
        Does the class implement the Lifecycle interface?