Class DefaultPropertyType.DefaultProperty

java.lang.Object
org.seasar.doma.jdbc.entity.DefaultPropertyType.DefaultProperty
All Implemented Interfaces:
Property<ENTITY,BASIC>, JdbcMappable<BASIC>, JdbcMappingHint
Enclosing class:
DefaultPropertyType<ENTITY,BASIC,CONTAINER>

protected class DefaultPropertyType.DefaultProperty extends Object implements Property<ENTITY,BASIC>
  • Field Details

  • Constructor Details

    • DefaultProperty

      protected DefaultProperty()
  • Method Details

    • get

      public Object get()
      Description copied from interface: Property
      Returns the current value of this property.

      The returned value may be wrapped in an Optional if the property is nullable.

      Specified by:
      get in interface Property<ENTITY,BASIC>
      Returns:
      the current value of this property, possibly wrapped in an Optional
    • getAsNonOptional

      public Object getAsNonOptional()
      Description copied from interface: Property
      Returns the non-optional value of this property.

      If the property value is wrapped in an Optional, this method unwraps it. This method may throw an exception if the property value is null.

      Specified by:
      getAsNonOptional in interface Property<ENTITY,BASIC>
      Returns:
      the non-optional value of this property
    • load

      public Property<ENTITY,BASIC> load(ENTITY entity)
      Description copied from interface: Property
      Loads the value from the entity into this property.

      This method extracts the property value from the given entity instance and stores it in this property object for later use.

      Specified by:
      load in interface Property<ENTITY,BASIC>
      Parameters:
      entity - the entity instance to load the value from
      Returns:
      this property instance for method chaining
    • save

      public Property<ENTITY,BASIC> save(ENTITY entity)
      Description copied from interface: Property
      Saves the current value of this property to the given entity instance.

      This method updates the property value in the given entity instance with the current value stored in this property object.

      Specified by:
      save in interface Property<ENTITY,BASIC>
      Parameters:
      entity - the entity instance to save the value to
      Returns:
      this property instance for method chaining
    • asInParameter

      public InParameter<BASIC> asInParameter()
      Description copied from interface: Property
      Returns this property as an InParameter for use in SQL execution.

      This method allows the property to be used as a parameter in SQL statements.

      Specified by:
      asInParameter in interface Property<ENTITY,BASIC>
      Returns:
      an input parameter representing this property's value
      See Also:
    • getWrapper

      public Wrapper<BASIC> getWrapper()
      Description copied from interface: JdbcMappable
      Returns the wrapper.
      Specified by:
      getWrapper in interface JdbcMappable<BASIC>
      Returns:
      the wrapper
    • getDomainClass

      public Optional<Class<?>> getDomainClass()
      Description copied from interface: JdbcMappingHint
      Returns the domain class if this object is mapped to the domain class.
      Specified by:
      getDomainClass in interface JdbcMappingHint
      Returns:
      the domain class
    • getJdbcType

      public Optional<JdbcType<Object>> getJdbcType()
      Description copied from interface: JdbcMappingHint
      Returns the JDBC type if the target value is mapped to the JDBC type.
      Specified by:
      getJdbcType in interface JdbcMappingHint
      Returns:
      the JDBC type
    • toString

      public String toString()
      Overrides:
      toString in class Object