Class ImmutableType<T>

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected ImmutableType​(java.lang.Class<T> clazz)
      Initialization constructor taking the Class and using the default Configuration object.
      protected ImmutableType​(java.lang.Class<T> clazz, Configuration configuration)
      Initialization constructor taking the Class and Configuration objects.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object assemble​(java.io.Serializable cached, java.lang.Object owner)  
      java.lang.Object assemble​(java.io.Serializable cached, org.hibernate.engine.spi.SharedSessionContractImplementor session, java.lang.Object owner)  
      void beforeAssemble​(java.io.Serializable cached, org.hibernate.engine.spi.SharedSessionContractImplementor session)  
      int compare​(java.lang.Object x, java.lang.Object y)  
      java.lang.Object deepCopy​(java.lang.Object value)  
      java.lang.Object deepCopy​(java.lang.Object value, org.hibernate.engine.spi.SessionFactoryImplementor factory)  
      org.hibernate.engine.jdbc.Size[] defaultSizes​(org.hibernate.engine.spi.Mapping mapping)  
      org.hibernate.engine.jdbc.Size[] dictatedSizes​(org.hibernate.engine.spi.Mapping mapping)  
      java.io.Serializable disassemble​(java.lang.Object o)  
      java.io.Serializable disassemble​(java.lang.Object value, org.hibernate.engine.spi.SharedSessionContractImplementor session, java.lang.Object owner)  
      boolean equals​(java.lang.Object x, java.lang.Object y)  
      protected abstract T get​(java.sql.ResultSet rs, java.lang.String[] names, org.hibernate.engine.spi.SharedSessionContractImplementor session, java.lang.Object owner)
      Get the column value from the JDBC ResultSet.
      int getColumnSpan​(org.hibernate.engine.spi.Mapping mapping)  
      protected Configuration getConfiguration()
      Get the current Configuration object.
      int getHashCode​(java.lang.Object x)  
      int getHashCode​(java.lang.Object x, org.hibernate.engine.spi.SessionFactoryImplementor factory)  
      java.lang.String getName()  
      java.lang.Class getReturnedClass()  
      org.hibernate.type.Type getSemiResolvedType​(org.hibernate.engine.spi.SessionFactoryImplementor factory)  
      int hashCode​(java.lang.Object x)  
      java.lang.Object hydrate​(java.sql.ResultSet rs, java.lang.String[] names, org.hibernate.engine.spi.SharedSessionContractImplementor session, java.lang.Object owner)  
      boolean isAnyType()  
      boolean isAssociationType()  
      boolean isCollectionType()  
      boolean isComponentType()  
      protected boolean isDirty​(java.lang.Object old, java.lang.Object current)  
      boolean isDirty​(java.lang.Object old, java.lang.Object current, boolean[] checkable, org.hibernate.engine.spi.SharedSessionContractImplementor session)  
      boolean isDirty​(java.lang.Object old, java.lang.Object current, org.hibernate.engine.spi.SharedSessionContractImplementor session)  
      boolean isEntityType()  
      boolean isEqual​(java.lang.Object x, java.lang.Object y)  
      boolean isEqual​(java.lang.Object x, java.lang.Object y, org.hibernate.engine.spi.SessionFactoryImplementor factory)  
      boolean isModified​(java.lang.Object dbState, java.lang.Object currentState, boolean[] checkable, org.hibernate.engine.spi.SharedSessionContractImplementor session)  
      boolean isMutable()  
      boolean isSame​(java.lang.Object x, java.lang.Object y)  
      java.lang.Object nullSafeGet​(java.sql.ResultSet rs, java.lang.String[] names, org.hibernate.engine.spi.SharedSessionContractImplementor session, java.lang.Object owner)  
      java.lang.Object nullSafeGet​(java.sql.ResultSet rs, java.lang.String name, org.hibernate.engine.spi.SharedSessionContractImplementor session, java.lang.Object owner)  
      void nullSafeSet​(java.sql.PreparedStatement st, java.lang.Object value, int index, boolean[] settable, org.hibernate.engine.spi.SharedSessionContractImplementor session)  
      void nullSafeSet​(java.sql.PreparedStatement st, java.lang.Object value, int index, org.hibernate.engine.spi.SharedSessionContractImplementor session)  
      java.lang.Object replace​(java.lang.Object o, java.lang.Object target, java.lang.Object owner)  
      java.lang.Object replace​(java.lang.Object original, java.lang.Object target, org.hibernate.engine.spi.SharedSessionContractImplementor session, java.lang.Object owner, java.util.Map copyCache)  
      java.lang.Object replace​(java.lang.Object original, java.lang.Object target, org.hibernate.engine.spi.SharedSessionContractImplementor session, java.lang.Object owner, java.util.Map copyCache, org.hibernate.type.ForeignKeyDirection foreignKeyDirection)  
      java.lang.Object resolve​(java.lang.Object value, org.hibernate.engine.spi.SharedSessionContractImplementor session, java.lang.Object owner)  
      java.lang.Class<T> returnedClass()  
      java.lang.Object semiResolve​(java.lang.Object value, org.hibernate.engine.spi.SharedSessionContractImplementor session, java.lang.Object owner)  
      protected abstract void set​(java.sql.PreparedStatement st, T value, int index, org.hibernate.engine.spi.SharedSessionContractImplementor session)
      Set the column value on the provided JDBC PreparedStatement.
      int[] sqlTypes​(org.hibernate.engine.spi.Mapping mapping)  
      boolean[] toColumnNullness​(java.lang.Object value, org.hibernate.engine.spi.Mapping mapping)  
      java.lang.String toLoggableString​(java.lang.Object value, org.hibernate.engine.spi.SessionFactoryImplementor factory)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.hibernate.type.Type

        resolve
      • Methods inherited from interface org.hibernate.usertype.UserType

        sqlTypes
    • Field Detail

      • clazz

        private final java.lang.Class<T> clazz
    • Constructor Detail

      • ImmutableType

        protected ImmutableType​(java.lang.Class<T> clazz)
        Initialization constructor taking the Class and using the default Configuration object.
        Parameters:
        clazz - the entity attribute Class type to be handled
      • ImmutableType

        protected ImmutableType​(java.lang.Class<T> clazz,
                                Configuration configuration)
        Initialization constructor taking the Class and Configuration objects.
        Parameters:
        clazz - the entity attribute Class type to be handled
        configuration - custom Configuration object.
    • Method Detail

      • get

        protected abstract T get​(java.sql.ResultSet rs,
                                 java.lang.String[] names,
                                 org.hibernate.engine.spi.SharedSessionContractImplementor session,
                                 java.lang.Object owner)
                          throws java.sql.SQLException
        Get the column value from the JDBC ResultSet.
        Parameters:
        rs - JDBC ResultSet
        names - database column name
        session - current Hibernate Session
        owner - current Hibernate SessionFactoryImplementor
        Returns:
        column value
        Throws:
        java.sql.SQLException - in case of failure
      • set

        protected abstract void set​(java.sql.PreparedStatement st,
                                    T value,
                                    int index,
                                    org.hibernate.engine.spi.SharedSessionContractImplementor session)
                             throws java.sql.SQLException
        Set the column value on the provided JDBC PreparedStatement.
        Parameters:
        st - JDBC PreparedStatement
        value - database column value
        index - database column index
        session - current Hibernate Session
        Throws:
        java.sql.SQLException - in case of failure
      • nullSafeGet

        public java.lang.Object nullSafeGet​(java.sql.ResultSet rs,
                                            java.lang.String[] names,
                                            org.hibernate.engine.spi.SharedSessionContractImplementor session,
                                            java.lang.Object owner)
                                     throws java.sql.SQLException
        Specified by:
        nullSafeGet in interface org.hibernate.type.Type
        Specified by:
        nullSafeGet in interface org.hibernate.usertype.UserType
        Throws:
        java.sql.SQLException
      • nullSafeSet

        public void nullSafeSet​(java.sql.PreparedStatement st,
                                java.lang.Object value,
                                int index,
                                org.hibernate.engine.spi.SharedSessionContractImplementor session)
                         throws java.sql.SQLException
        Specified by:
        nullSafeSet in interface org.hibernate.type.Type
        Specified by:
        nullSafeSet in interface org.hibernate.usertype.UserType
        Throws:
        java.sql.SQLException
      • returnedClass

        public java.lang.Class<T> returnedClass()
        Specified by:
        returnedClass in interface org.hibernate.usertype.UserType
      • equals

        public boolean equals​(java.lang.Object x,
                              java.lang.Object y)
        Specified by:
        equals in interface org.hibernate.usertype.UserType
      • hashCode

        public int hashCode​(java.lang.Object x)
        Specified by:
        hashCode in interface org.hibernate.usertype.UserType
      • deepCopy

        public java.lang.Object deepCopy​(java.lang.Object value)
        Specified by:
        deepCopy in interface org.hibernate.usertype.UserType
      • isMutable

        public boolean isMutable()
        Specified by:
        isMutable in interface org.hibernate.type.Type
        Specified by:
        isMutable in interface org.hibernate.usertype.UserType
      • disassemble

        public java.io.Serializable disassemble​(java.lang.Object o)
        Specified by:
        disassemble in interface org.hibernate.usertype.UserType
      • assemble

        public java.lang.Object assemble​(java.io.Serializable cached,
                                         java.lang.Object owner)
        Specified by:
        assemble in interface org.hibernate.usertype.UserType
      • replace

        public java.lang.Object replace​(java.lang.Object o,
                                        java.lang.Object target,
                                        java.lang.Object owner)
        Specified by:
        replace in interface org.hibernate.usertype.UserType
      • isAssociationType

        public boolean isAssociationType()
        Specified by:
        isAssociationType in interface org.hibernate.type.Type
      • isCollectionType

        public boolean isCollectionType()
        Specified by:
        isCollectionType in interface org.hibernate.type.Type
      • isEntityType

        public boolean isEntityType()
        Specified by:
        isEntityType in interface org.hibernate.type.Type
      • isAnyType

        public boolean isAnyType()
        Specified by:
        isAnyType in interface org.hibernate.type.Type
      • isComponentType

        public boolean isComponentType()
        Specified by:
        isComponentType in interface org.hibernate.type.Type
      • getColumnSpan

        public int getColumnSpan​(org.hibernate.engine.spi.Mapping mapping)
                          throws org.hibernate.MappingException
        Specified by:
        getColumnSpan in interface org.hibernate.type.Type
        Throws:
        org.hibernate.MappingException
      • sqlTypes

        public int[] sqlTypes​(org.hibernate.engine.spi.Mapping mapping)
                       throws org.hibernate.MappingException
        Specified by:
        sqlTypes in interface org.hibernate.type.Type
        Throws:
        org.hibernate.MappingException
      • dictatedSizes

        public org.hibernate.engine.jdbc.Size[] dictatedSizes​(org.hibernate.engine.spi.Mapping mapping)
                                                       throws org.hibernate.MappingException
        Specified by:
        dictatedSizes in interface org.hibernate.type.Type
        Throws:
        org.hibernate.MappingException
      • defaultSizes

        public org.hibernate.engine.jdbc.Size[] defaultSizes​(org.hibernate.engine.spi.Mapping mapping)
                                                      throws org.hibernate.MappingException
        Specified by:
        defaultSizes in interface org.hibernate.type.Type
        Throws:
        org.hibernate.MappingException
      • getReturnedClass

        public java.lang.Class getReturnedClass()
        Specified by:
        getReturnedClass in interface org.hibernate.type.Type
      • isSame

        public boolean isSame​(java.lang.Object x,
                              java.lang.Object y)
                       throws org.hibernate.HibernateException
        Specified by:
        isSame in interface org.hibernate.type.Type
        Throws:
        org.hibernate.HibernateException
      • isEqual

        public boolean isEqual​(java.lang.Object x,
                               java.lang.Object y)
                        throws org.hibernate.HibernateException
        Specified by:
        isEqual in interface org.hibernate.type.Type
        Throws:
        org.hibernate.HibernateException
      • isEqual

        public boolean isEqual​(java.lang.Object x,
                               java.lang.Object y,
                               org.hibernate.engine.spi.SessionFactoryImplementor factory)
                        throws org.hibernate.HibernateException
        Specified by:
        isEqual in interface org.hibernate.type.Type
        Throws:
        org.hibernate.HibernateException
      • getHashCode

        public int getHashCode​(java.lang.Object x)
                        throws org.hibernate.HibernateException
        Specified by:
        getHashCode in interface org.hibernate.type.Type
        Throws:
        org.hibernate.HibernateException
      • getHashCode

        public int getHashCode​(java.lang.Object x,
                               org.hibernate.engine.spi.SessionFactoryImplementor factory)
                        throws org.hibernate.HibernateException
        Specified by:
        getHashCode in interface org.hibernate.type.Type
        Throws:
        org.hibernate.HibernateException
      • compare

        public int compare​(java.lang.Object x,
                           java.lang.Object y)
        Specified by:
        compare in interface org.hibernate.type.Type
      • isDirty

        public final boolean isDirty​(java.lang.Object old,
                                     java.lang.Object current,
                                     org.hibernate.engine.spi.SharedSessionContractImplementor session)
        Specified by:
        isDirty in interface org.hibernate.type.Type
      • isDirty

        public final boolean isDirty​(java.lang.Object old,
                                     java.lang.Object current,
                                     boolean[] checkable,
                                     org.hibernate.engine.spi.SharedSessionContractImplementor session)
        Specified by:
        isDirty in interface org.hibernate.type.Type
      • isDirty

        protected final boolean isDirty​(java.lang.Object old,
                                        java.lang.Object current)
      • isModified

        public boolean isModified​(java.lang.Object dbState,
                                  java.lang.Object currentState,
                                  boolean[] checkable,
                                  org.hibernate.engine.spi.SharedSessionContractImplementor session)
                           throws org.hibernate.HibernateException
        Specified by:
        isModified in interface org.hibernate.type.Type
        Throws:
        org.hibernate.HibernateException
      • nullSafeGet

        public java.lang.Object nullSafeGet​(java.sql.ResultSet rs,
                                            java.lang.String name,
                                            org.hibernate.engine.spi.SharedSessionContractImplementor session,
                                            java.lang.Object owner)
                                     throws org.hibernate.HibernateException,
                                            java.sql.SQLException
        Specified by:
        nullSafeGet in interface org.hibernate.type.Type
        Throws:
        org.hibernate.HibernateException
        java.sql.SQLException
      • nullSafeSet

        public void nullSafeSet​(java.sql.PreparedStatement st,
                                java.lang.Object value,
                                int index,
                                boolean[] settable,
                                org.hibernate.engine.spi.SharedSessionContractImplementor session)
                         throws org.hibernate.HibernateException,
                                java.sql.SQLException
        Specified by:
        nullSafeSet in interface org.hibernate.type.Type
        Throws:
        org.hibernate.HibernateException
        java.sql.SQLException
      • toLoggableString

        public java.lang.String toLoggableString​(java.lang.Object value,
                                                 org.hibernate.engine.spi.SessionFactoryImplementor factory)
                                          throws org.hibernate.HibernateException
        Specified by:
        toLoggableString in interface org.hibernate.type.Type
        Throws:
        org.hibernate.HibernateException
      • getName

        public java.lang.String getName()
        Specified by:
        getName in interface org.hibernate.type.Type
      • deepCopy

        public java.lang.Object deepCopy​(java.lang.Object value,
                                         org.hibernate.engine.spi.SessionFactoryImplementor factory)
                                  throws org.hibernate.HibernateException
        Specified by:
        deepCopy in interface org.hibernate.type.Type
        Throws:
        org.hibernate.HibernateException
      • disassemble

        public java.io.Serializable disassemble​(java.lang.Object value,
                                                org.hibernate.engine.spi.SharedSessionContractImplementor session,
                                                java.lang.Object owner)
                                         throws org.hibernate.HibernateException
        Specified by:
        disassemble in interface org.hibernate.type.Type
        Throws:
        org.hibernate.HibernateException
      • assemble

        public java.lang.Object assemble​(java.io.Serializable cached,
                                         org.hibernate.engine.spi.SharedSessionContractImplementor session,
                                         java.lang.Object owner)
                                  throws org.hibernate.HibernateException
        Specified by:
        assemble in interface org.hibernate.type.Type
        Throws:
        org.hibernate.HibernateException
      • beforeAssemble

        public void beforeAssemble​(java.io.Serializable cached,
                                   org.hibernate.engine.spi.SharedSessionContractImplementor session)
        Specified by:
        beforeAssemble in interface org.hibernate.type.Type
      • hydrate

        public java.lang.Object hydrate​(java.sql.ResultSet rs,
                                        java.lang.String[] names,
                                        org.hibernate.engine.spi.SharedSessionContractImplementor session,
                                        java.lang.Object owner)
                                 throws org.hibernate.HibernateException,
                                        java.sql.SQLException
        Specified by:
        hydrate in interface org.hibernate.type.Type
        Throws:
        org.hibernate.HibernateException
        java.sql.SQLException
      • resolve

        public java.lang.Object resolve​(java.lang.Object value,
                                        org.hibernate.engine.spi.SharedSessionContractImplementor session,
                                        java.lang.Object owner)
                                 throws org.hibernate.HibernateException
        Specified by:
        resolve in interface org.hibernate.type.Type
        Throws:
        org.hibernate.HibernateException
      • semiResolve

        public java.lang.Object semiResolve​(java.lang.Object value,
                                            org.hibernate.engine.spi.SharedSessionContractImplementor session,
                                            java.lang.Object owner)
                                     throws org.hibernate.HibernateException
        Specified by:
        semiResolve in interface org.hibernate.type.Type
        Throws:
        org.hibernate.HibernateException
      • getSemiResolvedType

        public org.hibernate.type.Type getSemiResolvedType​(org.hibernate.engine.spi.SessionFactoryImplementor factory)
        Specified by:
        getSemiResolvedType in interface org.hibernate.type.Type
      • replace

        public java.lang.Object replace​(java.lang.Object original,
                                        java.lang.Object target,
                                        org.hibernate.engine.spi.SharedSessionContractImplementor session,
                                        java.lang.Object owner,
                                        java.util.Map copyCache)
                                 throws org.hibernate.HibernateException
        Specified by:
        replace in interface org.hibernate.type.Type
        Throws:
        org.hibernate.HibernateException
      • replace

        public java.lang.Object replace​(java.lang.Object original,
                                        java.lang.Object target,
                                        org.hibernate.engine.spi.SharedSessionContractImplementor session,
                                        java.lang.Object owner,
                                        java.util.Map copyCache,
                                        org.hibernate.type.ForeignKeyDirection foreignKeyDirection)
                                 throws org.hibernate.HibernateException
        Specified by:
        replace in interface org.hibernate.type.Type
        Throws:
        org.hibernate.HibernateException
      • toColumnNullness

        public boolean[] toColumnNullness​(java.lang.Object value,
                                          org.hibernate.engine.spi.Mapping mapping)
        Specified by:
        toColumnNullness in interface org.hibernate.type.Type