ENTITY
- the entity typeD
- the database typeV
- the field value typepublic interface ReferenceField<ENTITY,D,V> extends Field<ENTITY>, HasReferenceOperators<ENTITY>, HasReferenceValue<ENTITY,D,V>, HasMapToDoubleIfPresent<ENTITY,ToDoubleFunction<V>>
Field
,
HasReferenceOperators
,
HasReferenceValue
Modifier and Type | Method and Description |
---|---|
default ToBigDecimalNullable<ENTITY> |
asBigDecimal()
Returns an
ToBigDecimalNullable expression that has the value of
this field but casted to a BigDecimal . |
default ToBooleanNullable<ENTITY> |
asBoolean()
Returns an
ToBooleanNullable expression that has the value of
this field, casted to a boolean by first casting it to
Boolean . |
default ToByteNullable<ENTITY> |
asByte()
Returns an
ToByteNullable expression that has the value of this
field, casted to a byte by first casting it to Number and
then invoking Number.byteValue() . |
default ToCharNullable<ENTITY> |
asChar()
Returns an
ToCharNullable expression that has the value of this
field, casted to a char by first casting it to Number and
then invoking Number.intValue() and casting it to a char . |
default ToDoubleNullable<ENTITY> |
asDouble()
Returns an
ToDoubleNullable expression that has the value of this
field, casted to a double by first casting it to Number
and then invoking Number.doubleValue() . |
default <E extends Enum<E>> |
asEnum(Class<E> enumClass)
Returns an
ToBooleanNullable expression that has the value of
this field, casted to a particular enum class. |
default ToFloatNullable<ENTITY> |
asFloat()
Returns an
ToFloatNullable expression that has the value of this
field, casted to a float by first casting it to Number
and then invoking Number.floatValue() . |
default ToIntNullable<ENTITY> |
asInt()
Returns an
ToIntNullable expression that has the value of this
field, casted to a int by first casting it to Number and
then invoking Number.intValue() . |
default ToLongNullable<ENTITY> |
asLong()
Returns an
ToLongNullable expression that has the value of this
field, casted to a long by first casting it to Number and
then invoking Number.longValue() . |
default ToShortNullable<ENTITY> |
asShort()
Returns an
ToShortNullable expression that has the value of this
field, casted to a short by first casting it to Number
and then invoking Number.shortValue() . |
default ToStringNullable<ENTITY> |
asString()
Returns an
ToBooleanNullable expression that has the value of
this field, casted to a boolean by first casting it to
Boolean . |
static <ENTITY,D,V> |
create(ColumnIdentifier<ENTITY> identifier,
ReferenceGetter<ENTITY,V> getter,
ReferenceSetter<ENTITY,V> setter,
TypeMapper<D,V> typeMapper,
boolean unique)
Creates a new
ReferenceField using the default implementation. |
default ToBigDecimalNullable<ENTITY> |
mapToBigDecimalIfPresent(Function<V,BigDecimal> mapper)
Returns an
ToStringNullable expression that has the value
returned by the specified mapper function if the value for this field is
not null , and otherwise null . |
default ToBooleanNullable<ENTITY> |
mapToBooleanIfPresent(com.speedment.common.function.ToBooleanFunction<V> mapper)
Returns an
ToBooleanNullable expression that has the value
returned by the specified mapper function if the value for this field is
not null , and otherwise null . |
default ToByteNullable<ENTITY> |
mapToByteIfPresent(com.speedment.common.function.ToByteFunction<V> mapper)
Returns an
ToByteNullable expression that has the value returned
by the specified mapper function if the value for this field is not
null , and otherwise null . |
default ToCharNullable<ENTITY> |
mapToCharIfPresent(com.speedment.common.function.ToCharFunction<V> mapper)
Returns an
ToCharNullable expression that has the value returned
by the specified mapper function if the value for this field is not
null , and otherwise null . |
default ToDoubleNullable<ENTITY> |
mapToDoubleIfPresent(ToDoubleFunction<V> mapper)
Returns an
ToDoubleNullable expression that has the value
returned by the specified mapper function if the value for this field is
not null , and otherwise null . |
default <E extends Enum<E>> |
mapToEnumIfPresent(Function<V,E> mapper,
Class<E> enumClass)
Returns an
ToEnumNullable expression that has the value
returned by the specified mapper function if the value for this field is
not null , and otherwise null . |
default ToFloatNullable<ENTITY> |
mapToFloatIfPresent(com.speedment.common.function.ToFloatFunction<V> mapper)
Returns an
ToFloatNullable expression that has the value returned
by the specified mapper function if the value for this field is not
null , and otherwise null . |
default ToIntNullable<ENTITY> |
mapToIntIfPresent(ToIntFunction<V> mapper)
Returns an
ToIntNullable expression that has the value returned
by the specified mapper function if the value for this field is not
null , and otherwise null . |
default ToLongNullable<ENTITY> |
mapToLongIfPresent(ToLongFunction<V> mapper)
Returns an
ToLongNullable expression that has the value returned
by the specified mapper function if the value for this field is not
null , and otherwise null . |
default ToShortNullable<ENTITY> |
mapToShortIfPresent(com.speedment.common.function.ToShortFunction<V> mapper)
Returns an
ToShortNullable expression that has the value returned
by the specified mapper function if the value for this field is not
null , and otherwise null . |
default ToStringNullable<ENTITY> |
mapToStringIfPresent(Function<V,String> mapper)
Returns an
ToStringNullable expression that has the value
returned by the specified mapper function if the value for this field is
not null , and otherwise null . |
ReferenceField<ENTITY,D,V> |
tableAlias(String tableAlias)
Creates and returns a new Field with the provided
tableAlias . |
isNotNull, isNull
get, getter, set, setter, setTo, typeMapper
isUnique, tableAlias
findColumn, identifier
static <ENTITY,D,V> ReferenceField<ENTITY,D,V> create(ColumnIdentifier<ENTITY> identifier, ReferenceGetter<ENTITY,V> getter, ReferenceSetter<ENTITY,V> setter, TypeMapper<D,V> typeMapper, boolean unique)
ReferenceField
using the default implementation.ENTITY
- the entity typeD
- the database typeV
- the field value typeidentifier
- the column that this field representsgetter
- method reference to the getter in the entitysetter
- method reference to the setter in the entitytypeMapper
- the type mapper that is appliedunique
- represented column only contains unique valuesReferenceField<ENTITY,D,V> tableAlias(String tableAlias)
Field
tableAlias
. The new Field
will retain all other properties from this field except the tableAlias.tableAlias
in interface Field<ENTITY>
tableAlias
default ToByteNullable<ENTITY> mapToByteIfPresent(com.speedment.common.function.ToByteFunction<V> mapper)
ToByteNullable
expression that has the value returned
by the specified mapper function if the value for this field is not
null
, and otherwise null
.mapper
- the mapper operationdefault ToByteNullable<ENTITY> asByte()
ToByteNullable
expression that has the value of this
field, casted to a byte
by first casting it to Number
and
then invoking Number.byteValue()
.default ToShortNullable<ENTITY> mapToShortIfPresent(com.speedment.common.function.ToShortFunction<V> mapper)
ToShortNullable
expression that has the value returned
by the specified mapper function if the value for this field is not
null
, and otherwise null
.mapper
- the mapper operationdefault ToShortNullable<ENTITY> asShort()
ToShortNullable
expression that has the value of this
field, casted to a short
by first casting it to Number
and then invoking Number.shortValue()
.default ToIntNullable<ENTITY> mapToIntIfPresent(ToIntFunction<V> mapper)
ToIntNullable
expression that has the value returned
by the specified mapper function if the value for this field is not
null
, and otherwise null
.mapper
- the mapper operationdefault ToIntNullable<ENTITY> asInt()
ToIntNullable
expression that has the value of this
field, casted to a int
by first casting it to Number
and
then invoking Number.intValue()
.default ToLongNullable<ENTITY> mapToLongIfPresent(ToLongFunction<V> mapper)
ToLongNullable
expression that has the value returned
by the specified mapper function if the value for this field is not
null
, and otherwise null
.mapper
- the mapper operationdefault ToLongNullable<ENTITY> asLong()
ToLongNullable
expression that has the value of this
field, casted to a long
by first casting it to Number
and
then invoking Number.longValue()
.default ToFloatNullable<ENTITY> mapToFloatIfPresent(com.speedment.common.function.ToFloatFunction<V> mapper)
ToFloatNullable
expression that has the value returned
by the specified mapper function if the value for this field is not
null
, and otherwise null
.mapper
- the mapper operationdefault ToFloatNullable<ENTITY> asFloat()
ToFloatNullable
expression that has the value of this
field, casted to a float
by first casting it to Number
and then invoking Number.floatValue()
.default ToDoubleNullable<ENTITY> mapToDoubleIfPresent(ToDoubleFunction<V> mapper)
ToDoubleNullable
expression that has the value
returned by the specified mapper function if the value for this field is
not null
, and otherwise null
.mapToDoubleIfPresent
in interface HasMapToDoubleIfPresent<ENTITY,ToDoubleFunction<V>>
mapper
- the mapper operationdefault ToDoubleNullable<ENTITY> asDouble()
ToDoubleNullable
expression that has the value of this
field, casted to a double
by first casting it to Number
and then invoking Number.doubleValue()
.default ToCharNullable<ENTITY> mapToCharIfPresent(com.speedment.common.function.ToCharFunction<V> mapper)
ToCharNullable
expression that has the value returned
by the specified mapper function if the value for this field is not
null
, and otherwise null
.mapper
- the mapper operationdefault ToCharNullable<ENTITY> asChar()
ToCharNullable
expression that has the value of this
field, casted to a char
by first casting it to Number
and
then invoking Number.intValue()
and casting it to a char
.default ToBooleanNullable<ENTITY> mapToBooleanIfPresent(com.speedment.common.function.ToBooleanFunction<V> mapper)
ToBooleanNullable
expression that has the value
returned by the specified mapper function if the value for this field is
not null
, and otherwise null
.mapper
- the mapper operationdefault ToBooleanNullable<ENTITY> asBoolean()
ToBooleanNullable
expression that has the value of
this field, casted to a boolean
by first casting it to
Boolean
.default ToStringNullable<ENTITY> mapToStringIfPresent(Function<V,String> mapper)
ToStringNullable
expression that has the value
returned by the specified mapper function if the value for this field is
not null
, and otherwise null
.mapper
- the mapper operationdefault ToStringNullable<ENTITY> asString()
ToBooleanNullable
expression that has the value of
this field, casted to a boolean
by first casting it to
Boolean
.default ToBigDecimalNullable<ENTITY> mapToBigDecimalIfPresent(Function<V,BigDecimal> mapper)
ToStringNullable
expression that has the value
returned by the specified mapper function if the value for this field is
not null
, and otherwise null
.mapper
- the mapper operationdefault ToBigDecimalNullable<ENTITY> asBigDecimal()
ToBigDecimalNullable
expression that has the value of
this field but casted to a BigDecimal
.default <E extends Enum<E>> ToEnumNullable<ENTITY,E> mapToEnumIfPresent(Function<V,E> mapper, Class<E> enumClass)
ToEnumNullable
expression that has the value
returned by the specified mapper function if the value for this field is
not null
, and otherwise null
.mapper
- the mapper operationdefault <E extends Enum<E>> ToEnumNullable<ENTITY,E> asEnum(Class<E> enumClass)
ToBooleanNullable
expression that has the value of
this field, casted to a particular enum
class.Copyright © 2018 Speedment, Inc.. All rights reserved.