Package net.tangly.orm.imp
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
-
Field Summary
Fields Modifier and Type Field Description protected java.util.EnumMap<Property.ConverterType,java.util.function.Function<?,?>>convertersprotected java.lang.Class<T>entityClass of the owning entity of the property.protected java.lang.reflect.FieldfieldField associated with the property and used to get and set values of the property.protected java.lang.StringnameName 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.Fieldfield()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.Stringname()Returns the name of the property.intsqlType()
-
Field Details
-
name
protected final java.lang.String nameName of the property. -
entity
Class of the owning entity of the property. -
field
protected final java.lang.reflect.Field fieldField associated with the property and used to get and set values of the property. -
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
Description copied from interface:PropertyReturns the type of the entity owning the property. -
name
public java.lang.String name()Description copied from interface:PropertyReturns the name of the property. -
field
public java.lang.reflect.Field field()Description copied from interface:PropertyReturns the Java field associated with the property. -
sqlType
public int sqlType() -
jdbcType
public java.lang.Class<?> jdbcType() -
getConverter
public <T, R> java.util.function.Function<T,R> getConverter(@NotNull @NotNull Property.ConverterType type)- Specified by:
getConverterin interfaceProperty<T extends net.tangly.bus.core.HasOid>
-