Class ExtendedPropertyAccessor.GetterSetter

  • All Implemented Interfaces:
    Serializable, org.hibernate.property.access.spi.Getter, org.hibernate.property.access.spi.PropertyAccess, org.hibernate.property.access.spi.Setter
    Enclosing class:
    ExtendedPropertyAccessor

    static final class ExtendedPropertyAccessor.GetterSetter
    extends Object
    implements org.hibernate.property.access.spi.PropertyAccess, org.hibernate.property.access.spi.Getter, org.hibernate.property.access.spi.Setter
    This class implements the Hibernate Getter and Setter interfaces. For each property of an Extendable item there exist one Getter and Setter object.
    • Field Detail

      • strategy

        private final org.hibernate.property.access.spi.PropertyAccessStrategy strategy
      • clazz

        private final Class<?> clazz
      • property

        private final String property
    • Constructor Detail

      • GetterSetter

        GetterSetter​(org.hibernate.property.access.spi.PropertyAccessStrategy strategy,
                     Class<?> clazz,
                     String property)
        Create a new getter or setter.
        Parameters:
        clazz - The Class of the item
        property - The name of the extended property
    • Method Detail

      • getPropertyAccessStrategy

        public org.hibernate.property.access.spi.PropertyAccessStrategy getPropertyAccessStrategy()
        Specified by:
        getPropertyAccessStrategy in interface org.hibernate.property.access.spi.PropertyAccess
      • getGetter

        public org.hibernate.property.access.spi.Getter getGetter()
        Specified by:
        getGetter in interface org.hibernate.property.access.spi.PropertyAccess
      • getSetter

        public org.hibernate.property.access.spi.Setter getSetter()
        Specified by:
        getSetter in interface org.hibernate.property.access.spi.PropertyAccess
      • get

        public Object get​(Object target)
        Get the value of the extended property.
        Specified by:
        get in interface org.hibernate.property.access.spi.Getter
        Parameters:
        target - The ExtendableData that holds the value
        Throws:
        ClassCastException - If the target is not ExtendableData
      • getForInsert

        public Object getForInsert​(Object target,
                                   Map mergeMap,
                                   org.hibernate.engine.spi.SharedSessionContractImplementor session)
        Get the value of the extended property.
        Specified by:
        getForInsert in interface org.hibernate.property.access.spi.Getter
        Parameters:
        target - The ExtendableData that holds the value
        mergeMap - A map of merged persistent instances to detached instances, whatever that means...
        session - The session from which this request originated.
        Throws:
        ClassCastException - If the target is not ExtendableData
      • set

        public void set​(Object target,
                        Object value,
                        org.hibernate.engine.spi.SessionFactoryImplementor factory)
        Set the value of the extended property.
        Specified by:
        set in interface org.hibernate.property.access.spi.Setter
        Parameters:
        target - The Extendable that holds the value
        value - The new value
        factory - The session factory from which this request originated.
        Throws:
        ClassCastException - If the target is not ExtendableData
      • getMember

        public Member getMember()
        Always return null.
        Specified by:
        getMember in interface org.hibernate.property.access.spi.Getter
      • getReturnType

        public Class getReturnType()
        Always return null.
        Specified by:
        getReturnType in interface org.hibernate.property.access.spi.Getter
      • getMethodName

        public String getMethodName()
        Always return null.
        Specified by:
        getMethodName in interface org.hibernate.property.access.spi.Getter
        Specified by:
        getMethodName in interface org.hibernate.property.access.spi.Setter
      • getMethod

        public Method getMethod()
        Always return null.
        Specified by:
        getMethod in interface org.hibernate.property.access.spi.Getter
        Specified by:
        getMethod in interface org.hibernate.property.access.spi.Setter