Class ManyToOneType

    • Constructor Detail

      • ManyToOneType

        public ManyToOneType​(TypeFactory.TypeScope scope,
                             java.lang.String referencedEntityName)
        Creates a many-to-one association type with the given referenced entity.
        Parameters:
        scope - The scope for this instance.
        referencedEntityName - The name iof the referenced entity
      • ManyToOneType

        public ManyToOneType​(TypeFactory.TypeScope scope,
                             java.lang.String referencedEntityName,
                             boolean lazy)
        Creates a many-to-one association type with the given referenced entity and the given laziness characteristic
        Parameters:
        scope - The scope for this instance.
        referencedEntityName - The name iof the referenced entity
        lazy - Should the association be handled lazily
      • ManyToOneType

        public ManyToOneType​(TypeFactory.TypeScope scope,
                             java.lang.String referencedEntityName,
                             boolean referenceToPrimaryKey,
                             java.lang.String uniqueKeyPropertyName,
                             java.lang.String propertyName,
                             boolean lazy,
                             boolean unwrapProxy,
                             boolean ignoreNotFound,
                             boolean isLogicalOneToOne)
      • ManyToOneType

        public ManyToOneType​(ManyToOneType original,
                             java.lang.String superTypeEntityName)
    • Method Detail

      • isAlwaysDirtyChecked

        public boolean isAlwaysDirtyChecked()
        Description copied from interface: AssociationType
        Do we dirty check this association, even when there are no columns to be updated?
      • isOneToOne

        public boolean isOneToOne()
        Description copied from class: EntityType
        Is the association modeled here defined as a 1-1 in the database (physical model)?
        Specified by:
        isOneToOne in class EntityType
        Returns:
        True if a 1-1 in the database; false otherwise.
      • isLogicalOneToOne

        public boolean isLogicalOneToOne()
        Description copied from class: EntityType
        Is the association modeled here a 1-1 according to the logical moidel?
        Overrides:
        isLogicalOneToOne in class EntityType
        Returns:
        True if a 1-1 in the logical model; false otherwise.
      • getColumnSpan

        public int getColumnSpan​(Mapping mapping)
                          throws MappingException
        Description copied from interface: Type
        How many columns are used to persist this type. Always the same as sqlTypes(mapping).length
        Parameters:
        mapping - The mapping object :/
        Returns:
        The number of columns
        Throws:
        MappingException - Generally indicates an issue accessing the passed mapping object.
      • sqlTypes

        public int[] sqlTypes​(Mapping mapping)
                       throws MappingException
        Description copied from interface: Type
        Return the JDBC types codes (per Types) for the columns mapped by this type.

        NOTE: The number of elements in this array matches the return from Type.getColumnSpan(org.hibernate.engine.spi.Mapping).

        Parameters:
        mapping - The mapping object :/
        Returns:
        The JDBC type codes.
        Throws:
        MappingException - Generally indicates an issue accessing the passed mapping object.
      • dictatedSizes

        public Size[] dictatedSizes​(Mapping mapping)
                             throws MappingException
        Description copied from interface: Type
        Return the column sizes dictated by this type. For example, the mapping for a char/Character would have a dictated length limit of 1; for a string-based UUID would have a size limit of 36; etc.

        NOTE: The number of elements in this array matches the return from Type.getColumnSpan(org.hibernate.engine.spi.Mapping).

        Parameters:
        mapping - The mapping object :/
        Returns:
        The dictated sizes.
        Throws:
        MappingException - Generally indicates an issue accessing the passed mapping object.
      • getForeignKeyDirection

        public ForeignKeyDirection getForeignKeyDirection()
        Description copied from interface: AssociationType
        Get the foreign key directionality of this association
      • useLHSPrimaryKey

        public boolean useLHSPrimaryKey()
        Description copied from interface: AssociationType
        Is the primary key of the owning entity table to be used in the join?
      • disassemble

        public java.io.Serializable disassemble​(java.lang.Object value,
                                                SharedSessionContractImplementor session,
                                                java.lang.Object owner)
                                         throws HibernateException
        Description copied from interface: Type
        Return a disassembled representation of the object. This is the value Hibernate will use in second level caching, so care should be taken to break values down to their simplest forms; for entities especially, this means breaking them down into their constituent parts.
        Specified by:
        disassemble in interface Type
        Overrides:
        disassemble in class AbstractType
        Parameters:
        value - the value to cache
        session - the originating session
        owner - optional parent entity object (needed for collections)
        Returns:
        the disassembled, deep cloned state
        Throws:
        HibernateException - An error from Hibernate
      • beforeAssemble

        public void beforeAssemble​(java.io.Serializable oid,
                                   SharedSessionContractImplementor session)
        Description copied from interface: Type
        Called before assembling a query result set from the query cache, to allow batch fetching of entities missing from the second-level cache.
        Specified by:
        beforeAssemble in interface Type
        Overrides:
        beforeAssemble in class AbstractType
        Parameters:
        oid - The key
        session - The originating session
      • toColumnNullness

        public boolean[] toColumnNullness​(java.lang.Object value,
                                          Mapping mapping)
        Description copied from interface: Type
        Given an instance of the type, return an array of boolean, indicating which mapped columns would be null.
        Parameters:
        value - an instance of the type
        mapping - The mapping abstraction
        Returns:
        array indicating column nullness for a value instance
      • isDirty

        public boolean isDirty​(java.lang.Object old,
                               java.lang.Object current,
                               SharedSessionContractImplementor session)
                        throws HibernateException
        Description copied from interface: Type
        Should the parent be considered dirty, given both the old and current value?
        Specified by:
        isDirty in interface Type
        Overrides:
        isDirty in class AbstractType
        Parameters:
        old - the old value
        current - the current value
        session - The session from which the request originated.
        Returns:
        true if the field is dirty
        Throws:
        HibernateException - A problem occurred performing the checking
      • isDirty

        public boolean isDirty​(java.lang.Object old,
                               java.lang.Object current,
                               boolean[] checkable,
                               SharedSessionContractImplementor session)
                        throws HibernateException
        Description copied from interface: Type
        Should the parent be considered dirty, given both the old and current value?
        Parameters:
        old - the old value
        current - the current value
        checkable - An array of booleans indicating which columns making up the value are actually checkable
        session - The session from which the request originated.
        Returns:
        true if the field is dirty
        Throws:
        HibernateException - A problem occurred performing the checking