Class PropertySimple<T extends net.tangly.bus.core.HasOid>

java.lang.Object
net.tangly.orm.imp.PropertySimple<T>
Type Parameters:
T - class owning the property
All Implemented Interfaces:
Property<T>
Direct Known Subclasses:
PropertyCode, PropertyJson, PropertyOne2One

public class PropertySimple<T extends net.tangly.bus.core.HasOid>
extends java.lang.Object
implements Property<T>
Models a property with simple Java objects or primitive. The type of the property is not defined through a DAO.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface net.tangly.orm.Property

    Property.ConverterType
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected java.util.EnumMap<Property.ConverterType,​java.util.function.Function<?,​?>> converters  
    protected java.lang.Class<T> entity
    Class of the owning entity of the property.
    protected java.lang.reflect.Field field
    Field associated with the property and used to get and set values of the property.
    protected java.lang.String name
    Name of the property.
  • Constructor Summary

    Constructors 
    Constructor Description
    PropertySimple​(@NotNull java.lang.String name, @NotNull java.lang.Class<T> entity, @NotNull java.lang.Class<?> jdbcType, int sqlType, @NotNull java.util.Map<Property.ConverterType,​java.util.function.Function<?,​?>> converters)  
  • Method Summary

    Modifier and Type Method Description
    java.lang.Class<T> entity()
    Returns the type of the entity owning the property.
    java.lang.reflect.Field field()
    Returns the Java field associated with the property.
    <T,​ R> java.util.function.Function<T,​R> getConverter​(@NotNull Property.ConverterType type)  
    java.lang.Class<?> jdbcType()  
    java.lang.String name()
    Returns the name of the property.
    int sqlType()  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.tangly.orm.Property

    get, getParameter, set, setParameter
  • Field Details

    • name

      protected final java.lang.String name
      Name of the property.
    • entity

      protected final java.lang.Class<T extends net.tangly.bus.core.HasOid> entity
      Class of the owning entity of the property.
    • field

      protected final java.lang.reflect.Field field
      Field associated with the property and used to get and set values of the property.
    • converters

      protected java.util.EnumMap<Property.ConverterType,​java.util.function.Function<?,​?>> converters
  • Constructor Details

    • PropertySimple

      public PropertySimple​(@NotNull @NotNull java.lang.String name, @NotNull @NotNull java.lang.Class<T> entity, @NotNull @NotNull java.lang.Class<?> jdbcType, int sqlType, @NotNull @NotNull java.util.Map<Property.ConverterType,​java.util.function.Function<?,​?>> converters)
  • Method Details

    • entity

      public java.lang.Class<T> entity()
      Description copied from interface: Property
      Returns the type of the entity owning the property.
      Specified by:
      entity in interface Property<T extends net.tangly.bus.core.HasOid>
      Returns:
      type of the declaring entity
    • name

      public java.lang.String name()
      Description copied from interface: Property
      Returns the name of the property.
      Specified by:
      name in interface Property<T extends net.tangly.bus.core.HasOid>
      Returns:
      name of the property
    • field

      public java.lang.reflect.Field field()
      Description copied from interface: Property
      Returns the Java field associated with the property.
      Specified by:
      field in interface Property<T extends net.tangly.bus.core.HasOid>
      Returns:
      field of the property
    • sqlType

      public int sqlType()
      Specified by:
      sqlType in interface Property<T extends net.tangly.bus.core.HasOid>
    • jdbcType

      public java.lang.Class<?> jdbcType()
      Specified by:
      jdbcType in interface Property<T extends net.tangly.bus.core.HasOid>
    • getConverter

      public <T,​ R> java.util.function.Function<T,​R> getConverter​(@NotNull @NotNull Property.ConverterType type)
      Specified by:
      getConverter in interface Property<T extends net.tangly.bus.core.HasOid>