类 CompositeCustomType

    • 方法详细资料

      • getName

        public String getName()
        从接口复制的说明: Type
        Returns the abbreviated name of the type.
        指定者:
        getName 在接口中 Type
        返回:
        String the Hibernate type name
      • isMutable

        public boolean isMutable()
        从接口复制的说明: Type
        Are objects of this type mutable. (With respect to the referencing object ... entities and collections are considered immutable because they manage their own internal state.)
        指定者:
        isMutable 在接口中 Type
        返回:
        boolean
      • getRegistrationKeys

        public String[] getRegistrationKeys()
        从接口复制的说明: BasicType
        Get the names under which this type should be registered in the type registry.
        指定者:
        getRegistrationKeys 在接口中 BasicType
        返回:
        The keys under which to register this type.
      • isMethodOf

        public boolean isMethodOf​(Method method)
        从接口复制的说明: CompositeType
        Is the given method a member of this component's class?
        指定者:
        isMethodOf 在接口中 CompositeType
        参数:
        method - The method to check
        返回:
        True if the method is a member; false otherwise.
      • getSubtypes

        public Type[] getSubtypes()
        从接口复制的说明: CompositeType
        Get the types of the component properties
        指定者:
        getSubtypes 在接口中 CompositeType
        返回:
        The component property types.
      • getPropertyIndex

        public int getPropertyIndex​(String name)
        从接口复制的说明: CompositeType
        Convenience method for locating the property index for a given property name.
        指定者:
        getPropertyIndex 在接口中 CompositeType
        参数:
        name - The (sub-)property name to find.
        返回:
        The (sub-)property index, relative to all the array-valued method returns defined on this contract.
      • getPropertyValues

        public Object[] getPropertyValues​(Object component,
                                          EntityMode entityMode)
                                   throws HibernateException
        从接口复制的说明: CompositeType
        Extract the values of the component properties from the given component instance without access to the session.

        An optional operation

        指定者:
        getPropertyValues 在接口中 CompositeType
        参数:
        component - The component instance
        entityMode - The entity mode
        返回:
        The property values
        抛出:
        HibernateException - Indicates a problem access the property values.
      • getCascadeStyle

        public CascadeStyle getCascadeStyle​(int i)
        从接口复制的说明: CompositeType
        Retrieve the cascade style of the indicated component property.
        指定者:
        getCascadeStyle 在接口中 CompositeType
        参数:
        i - The property index,
        返回:
        The cascade style.
      • getFetchMode

        public FetchMode getFetchMode​(int i)
        从接口复制的说明: CompositeType
        Retrieve the fetch mode of the indicated component property.
        指定者:
        getFetchMode 在接口中 CompositeType
        参数:
        i - The property index,
        返回:
        The fetch mode
      • isComponentType

        public boolean isComponentType()
        从接口复制的说明: Type
        Return true if the implementation is castable to CompositeType. Essentially a polymorphic version of (type instanceof CompositeType.class). A component type may own collections or associations and hence must provide certain extra functionality.
        指定者:
        isComponentType 在接口中 Type
        覆盖:
        isComponentType 在类中 AbstractType
        返回:
        True if this type is also a CompositeType implementor; false otherwise.
      • disassemble

        public Serializable disassemble​(Object value,
                                        SharedSessionContractImplementor session,
                                        Object owner)
                                 throws HibernateException
        从接口复制的说明: 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.
        指定者:
        disassemble 在接口中 Type
        覆盖:
        disassemble 在类中 AbstractType
        参数:
        value - the value to cache
        session - the originating session
        owner - optional parent entity object (needed for collections)
        返回:
        the disassembled, deep cloned state
        抛出:
        HibernateException - An error from Hibernate
      • replace

        public Object replace​(Object original,
                              Object target,
                              SharedSessionContractImplementor session,
                              Object owner,
                              Map copyCache)
                       throws HibernateException
        从接口复制的说明: Type
        During merge, replace the existing (target) value in the entity we are merging to with a new (original) value from the detached entity we are merging. For immutable objects, or null values, it is safe to simply return the first parameter. For mutable objects, it is safe to return a copy of the first parameter. For objects with component values, it might make sense to recursively replace component values.
        指定者:
        replace 在接口中 Type
        参数:
        original - the value from the detached entity being merged
        target - the value in the managed entity
        session - The originating session
        owner - The owner of the value
        copyCache - The cache of already copied/replaced values
        返回:
        the value to be merged
        抛出:
        HibernateException - An error from Hibernate
      • isEqual

        public boolean isEqual​(Object x,
                               Object y)
                        throws HibernateException
        从接口复制的说明: Type
        Compare two instances of the class mapped by this type for persistence "equality" (equality of persistent state).

        This should always equate to some form of comparison of the value's internal state. As an example, for something like a date the comparison should be based on its internal "time" state based on the specific portion it is meant to represent (timestamp, date, time).

        指定者:
        isEqual 在接口中 Type
        覆盖:
        isEqual 在类中 AbstractType
        参数:
        x - The first value
        y - The second value
        返回:
        True if there are considered equal (see discussion above).
        抛出:
        HibernateException - A problem occurred performing the comparison
      • getHashCode

        public int getHashCode​(Object x)
        从接口复制的说明: Type
        Get a hash code, consistent with persistence "equality". Again for most types the normal usage is to delegate to the value's hashCode.
        指定者:
        getHashCode 在接口中 Type
        覆盖:
        getHashCode 在类中 AbstractType
        参数:
        x - The value for which to retrieve a hash code
        返回:
        The hash code
      • getColumnSpan

        public int getColumnSpan​(Mapping mapping)
                          throws MappingException
        从接口复制的说明: Type
        How many columns are used to persist this type. Always the same as sqlTypes(mapping).length
        指定者:
        getColumnSpan 在接口中 Type
        参数:
        mapping - The mapping object :/
        返回:
        The number of columns
        抛出:
        MappingException - Generally indicates an issue accessing the passed mapping object.
      • nullSafeGet

        public Object nullSafeGet​(ResultSet rs,
                                  String columnName,
                                  SharedSessionContractImplementor session,
                                  Object owner)
                           throws HibernateException,
                                  SQLException
        从接口复制的说明: Type
        Extract a value of the mapped class from the JDBC result set. Implementors should handle possibility of null values. This form might be called if the type is known to be a single-column type.
        指定者:
        nullSafeGet 在接口中 Type
        参数:
        rs - The result set from which to extract value.
        columnName - the column name making up this type value (use to read from result set)
        session - The originating session
        owner - the parent entity
        返回:
        The extracted value
        抛出:
        HibernateException - An error from Hibernate
        SQLException - An error from the JDBC driver
      • nullSafeSet

        public void nullSafeSet​(PreparedStatement st,
                                Object value,
                                int index,
                                boolean[] settable,
                                SharedSessionContractImplementor session)
                         throws HibernateException,
                                SQLException
        从接口复制的说明: Type
        Bind a value represented by an instance of the mapped class to the JDBC prepared statement, ignoring some columns as dictated by the 'settable' parameter. Implementors should handle the possibility of null values. A multi-column type should bind parameters starting from index.
        指定者:
        nullSafeSet 在接口中 Type
        参数:
        st - The JDBC prepared statement to which to bind
        value - the object to write
        index - starting parameter bind index
        settable - an array indicating which columns to bind/ignore
        session - The originating session
        抛出:
        HibernateException - An error from Hibernate
        SQLException - An error from the JDBC driver
      • getPropertyNullability

        public boolean[] getPropertyNullability()
        从接口复制的说明: CompositeType
        Retrieve the indicators regarding which component properties are nullable.

        An optional operation

        指定者:
        getPropertyNullability 在接口中 CompositeType
        返回:
        nullability of component properties
      • toColumnNullness

        public boolean[] toColumnNullness​(Object value,
                                          Mapping mapping)
        从接口复制的说明: Type
        Given an instance of the type, return an array of boolean, indicating which mapped columns would be null.
        指定者:
        toColumnNullness 在接口中 Type
        参数:
        value - an instance of the type
        mapping - The mapping abstraction
        返回:
        array indicating column nullness for a value instance
      • isDirty

        public boolean isDirty​(Object old,
                               Object current,
                               boolean[] checkable,
                               SharedSessionContractImplementor session)
                        throws HibernateException
        从接口复制的说明: Type
        Should the parent be considered dirty, given both the old and current value?
        指定者:
        isDirty 在接口中 Type
        参数:
        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.
        返回:
        true if the field is dirty
        抛出:
        HibernateException - A problem occurred performing the checking
      • isEmbedded

        public boolean isEmbedded()
        从接口复制的说明: CompositeType
        Is this component embedded? "embedded" indicates that the component is "virtual", that its properties are "flattened" onto its owner
        指定者:
        isEmbedded 在接口中 CompositeType
        返回:
        True if this component is embedded; false otherwise.