- Type Parameters:
ENTITY- the entity typeV- the field value type
- All Superinterfaces:
Field<ENTITY>,HasColumnName,HasGetter<ENTITY>,com.speedment.runtime.compute.trait.HasMapToDoubleIfPresent<ENTITY,,ToDoubleFunction<V>> HasReferenceOperators<ENTITY>,HasReferenceValue<ENTITY,,V> HasTable<ENTITY>
- All Known Subinterfaces:
ComparableField<ENTITY,,V> EnumField<ENTITY,,E> StringField<ENTITY>
public interface ReferenceField<ENTITY,V>
extends Field<ENTITY>, HasReferenceOperators<ENTITY>, HasReferenceValue<ENTITY,V>, com.speedment.runtime.compute.trait.HasMapToDoubleIfPresent<ENTITY,ToDoubleFunction<V>>
A field that represents an object value.
- Since:
- 2.2.0
- Author:
- Per Minborg, Emil Forslund
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault com.speedment.runtime.compute.ToBigDecimalNullable<ENTITY>Returns anToBigDecimalNullableexpression that has the value of this field but casted to aBigDecimal.default com.speedment.runtime.compute.ToBooleanNullable<ENTITY>Returns anToBooleanNullableexpression that has the value of this field, casted to abooleanby first casting it toBoolean.default com.speedment.runtime.compute.ToByteNullable<ENTITY>asByte()Returns anToByteNullableexpression that has the value of this field, casted to abyteby first casting it toNumberand then invokingNumber.byteValue().default com.speedment.runtime.compute.ToCharNullable<ENTITY>asChar()Returns anToCharNullableexpression that has the value of this field, casted to acharby first casting it toNumberand then invokingNumber.intValue()and casting it to achar.default com.speedment.runtime.compute.ToDoubleNullable<ENTITY>asDouble()Returns anToDoubleNullableexpression that has the value of this field, casted to adoubleby first casting it toNumberand then invokingNumber.doubleValue().Returns anToBooleanNullableexpression that has the value of this field, casted to a particularenumclass.default com.speedment.runtime.compute.ToFloatNullable<ENTITY>asFloat()Returns anToFloatNullableexpression that has the value of this field, casted to afloatby first casting it toNumberand then invokingNumber.floatValue().default com.speedment.runtime.compute.ToIntNullable<ENTITY>asInt()Returns anToIntNullableexpression that has the value of this field, casted to aintby first casting it toNumberand then invokingNumber.intValue().default com.speedment.runtime.compute.ToLongNullable<ENTITY>asLong()Returns anToLongNullableexpression that has the value of this field, casted to alongby first casting it toNumberand then invokingNumber.longValue().default com.speedment.runtime.compute.ToShortNullable<ENTITY>asShort()Returns anToShortNullableexpression that has the value of this field, casted to ashortby first casting it toNumberand then invokingNumber.shortValue().default com.speedment.runtime.compute.ToStringNullable<ENTITY>asString()Returns anToBooleanNullableexpression that has the value of this field, casted to abooleanby first casting it toBoolean.static <ENTITY,V> ReferenceField<ENTITY, V> create(Class<ENTITY> table, String columnName, ReferenceGetter<ENTITY, V> getter, boolean unique) Creates a newReferenceFieldusing the default implementation.default com.speedment.runtime.compute.ToBigDecimalNullable<ENTITY>mapToBigDecimalIfPresent(Function<V, BigDecimal> mapper) Returns anToStringNullableexpression that has the value returned by the specified mapper function if the value for this field is notnull, and otherwisenull.default com.speedment.runtime.compute.ToBooleanNullable<ENTITY>mapToBooleanIfPresent(com.speedment.common.function.ToBooleanFunction<V> mapper) Returns anToBooleanNullableexpression that has the value returned by the specified mapper function if the value for this field is notnull, and otherwisenull.default com.speedment.runtime.compute.ToByteNullable<ENTITY>mapToByteIfPresent(com.speedment.common.function.ToByteFunction<V> mapper) Returns anToByteNullableexpression that has the value returned by the specified mapper function if the value for this field is notnull, and otherwisenull.default com.speedment.runtime.compute.ToCharNullable<ENTITY>mapToCharIfPresent(com.speedment.common.function.ToCharFunction<V> mapper) Returns anToCharNullableexpression that has the value returned by the specified mapper function if the value for this field is notnull, and otherwisenull.default com.speedment.runtime.compute.ToDoubleNullable<ENTITY>mapToDoubleIfPresent(ToDoubleFunction<V> mapper) Returns anToDoubleNullableexpression that has the value returned by the specified mapper function if the value for this field is notnull, and otherwisenull.mapToEnumIfPresent(Function<V, E> mapper, Class<E> enumClass) Returns anToEnumNullableexpression that has the value returned by the specified mapper function if the value for this field is notnull, and otherwisenull.default com.speedment.runtime.compute.ToFloatNullable<ENTITY>mapToFloatIfPresent(com.speedment.common.function.ToFloatFunction<V> mapper) Returns anToFloatNullableexpression that has the value returned by the specified mapper function if the value for this field is notnull, and otherwisenull.default com.speedment.runtime.compute.ToIntNullable<ENTITY>mapToIntIfPresent(ToIntFunction<V> mapper) Returns anToIntNullableexpression that has the value returned by the specified mapper function if the value for this field is notnull, and otherwisenull.default com.speedment.runtime.compute.ToLongNullable<ENTITY>mapToLongIfPresent(ToLongFunction<V> mapper) Returns anToLongNullableexpression that has the value returned by the specified mapper function if the value for this field is notnull, and otherwisenull.default com.speedment.runtime.compute.ToShortNullable<ENTITY>mapToShortIfPresent(com.speedment.common.function.ToShortFunction<V> mapper) Returns anToShortNullableexpression that has the value returned by the specified mapper function if the value for this field is notnull, and otherwisenull.default com.speedment.runtime.compute.ToStringNullable<ENTITY>mapToStringIfPresent(Function<V, String> mapper) Returns anToStringNullableexpression that has the value returned by the specified mapper function if the value for this field is notnull, and otherwisenull.Methods inherited from interface com.speedment.jpastreamer.field.trait.HasColumnName
columnNameMethods inherited from interface com.speedment.jpastreamer.field.trait.HasReferenceOperators
isNotNull, isNullMethods inherited from interface com.speedment.jpastreamer.field.trait.HasReferenceValue
get, getter
-
Method Details
-
create
static <ENTITY,V> ReferenceField<ENTITY,V> create(Class<ENTITY> table, String columnName, ReferenceGetter<ENTITY, V> getter, boolean unique) Creates a newReferenceFieldusing the default implementation.- Type Parameters:
ENTITY- the entity typeV- the field value type- Parameters:
table- the column that this field representscolumnName- the name of the database column the field representsgetter- method reference to the getter in the entityunique- represented column only contains unique values- Returns:
- the created field
-
mapToByteIfPresent
default com.speedment.runtime.compute.ToByteNullable<ENTITY> mapToByteIfPresent(com.speedment.common.function.ToByteFunction<V> mapper) Returns anToByteNullableexpression that has the value returned by the specified mapper function if the value for this field is notnull, and otherwisenull.- Parameters:
mapper- the mapper operation- Returns:
- expression for this value after mapper has been applied
- Since:
- 3.1.0
-
asByte
Returns anToByteNullableexpression that has the value of this field, casted to abyteby first casting it toNumberand then invokingNumber.byteValue().- Returns:
- expression for this value after mapper has been applied
- Since:
- 3.1.0
-
mapToShortIfPresent
default com.speedment.runtime.compute.ToShortNullable<ENTITY> mapToShortIfPresent(com.speedment.common.function.ToShortFunction<V> mapper) Returns anToShortNullableexpression that has the value returned by the specified mapper function if the value for this field is notnull, and otherwisenull.- Parameters:
mapper- the mapper operation- Returns:
- expression for this value after mapper has been applied
- Since:
- 3.1.0
-
asShort
Returns anToShortNullableexpression that has the value of this field, casted to ashortby first casting it toNumberand then invokingNumber.shortValue().- Returns:
- expression for this value after mapper has been applied
- Since:
- 3.1.0
-
mapToIntIfPresent
default com.speedment.runtime.compute.ToIntNullable<ENTITY> mapToIntIfPresent(ToIntFunction<V> mapper) Returns anToIntNullableexpression that has the value returned by the specified mapper function if the value for this field is notnull, and otherwisenull.- Parameters:
mapper- the mapper operation- Returns:
- expression for this value after mapper has been applied
- Since:
- 3.1.0
-
asInt
Returns anToIntNullableexpression that has the value of this field, casted to aintby first casting it toNumberand then invokingNumber.intValue().- Returns:
- expression for this value after mapper has been applied
- Since:
- 3.1.0
-
mapToLongIfPresent
default com.speedment.runtime.compute.ToLongNullable<ENTITY> mapToLongIfPresent(ToLongFunction<V> mapper) Returns anToLongNullableexpression that has the value returned by the specified mapper function if the value for this field is notnull, and otherwisenull.- Parameters:
mapper- the mapper operation- Returns:
- expression for this value after mapper has been applied
- Since:
- 3.1.0
-
asLong
Returns anToLongNullableexpression that has the value of this field, casted to alongby first casting it toNumberand then invokingNumber.longValue().- Returns:
- expression for this value after mapper has been applied
- Since:
- 3.1.0
-
mapToFloatIfPresent
default com.speedment.runtime.compute.ToFloatNullable<ENTITY> mapToFloatIfPresent(com.speedment.common.function.ToFloatFunction<V> mapper) Returns anToFloatNullableexpression that has the value returned by the specified mapper function if the value for this field is notnull, and otherwisenull.- Parameters:
mapper- the mapper operation- Returns:
- expression for this value after mapper has been applied
- Since:
- 3.1.0
-
asFloat
Returns anToFloatNullableexpression that has the value of this field, casted to afloatby first casting it toNumberand then invokingNumber.floatValue().- Returns:
- expression for this value after mapper has been applied
- Since:
- 3.1.0
-
mapToDoubleIfPresent
default com.speedment.runtime.compute.ToDoubleNullable<ENTITY> mapToDoubleIfPresent(ToDoubleFunction<V> mapper) Returns anToDoubleNullableexpression that has the value returned by the specified mapper function if the value for this field is notnull, and otherwisenull. -
asDouble
Returns anToDoubleNullableexpression that has the value of this field, casted to adoubleby first casting it toNumberand then invokingNumber.doubleValue().- Returns:
- expression for this value after mapper has been applied
- Since:
- 3.1.0
-
mapToCharIfPresent
default com.speedment.runtime.compute.ToCharNullable<ENTITY> mapToCharIfPresent(com.speedment.common.function.ToCharFunction<V> mapper) Returns anToCharNullableexpression that has the value returned by the specified mapper function if the value for this field is notnull, and otherwisenull.- Parameters:
mapper- the mapper operation- Returns:
- expression for this value after mapper has been applied
- Since:
- 3.1.0
-
asChar
Returns anToCharNullableexpression that has the value of this field, casted to acharby first casting it toNumberand then invokingNumber.intValue()and casting it to achar.- Returns:
- expression for this value after mapper has been applied
- Since:
- 3.1.0
-
mapToBooleanIfPresent
default com.speedment.runtime.compute.ToBooleanNullable<ENTITY> mapToBooleanIfPresent(com.speedment.common.function.ToBooleanFunction<V> mapper) Returns anToBooleanNullableexpression that has the value returned by the specified mapper function if the value for this field is notnull, and otherwisenull.- Parameters:
mapper- the mapper operation- Returns:
- expression for this value after mapper has been applied
- Since:
- 3.1.0
-
asBoolean
Returns anToBooleanNullableexpression that has the value of this field, casted to abooleanby first casting it toBoolean.- Returns:
- expression for this value after mapper has been applied
- Since:
- 3.1.0
-
mapToStringIfPresent
default com.speedment.runtime.compute.ToStringNullable<ENTITY> mapToStringIfPresent(Function<V, String> mapper) Returns anToStringNullableexpression that has the value returned by the specified mapper function if the value for this field is notnull, and otherwisenull.- Parameters:
mapper- the mapper operation- Returns:
- expression for this value after mapper has been applied
- Since:
- 3.1.0
-
asString
Returns anToBooleanNullableexpression that has the value of this field, casted to abooleanby first casting it toBoolean.- Returns:
- expression for this value after mapper has been applied
- Since:
- 3.1.0
-
mapToBigDecimalIfPresent
default com.speedment.runtime.compute.ToBigDecimalNullable<ENTITY> mapToBigDecimalIfPresent(Function<V, BigDecimal> mapper) Returns anToStringNullableexpression that has the value returned by the specified mapper function if the value for this field is notnull, and otherwisenull.- Parameters:
mapper- the mapper operation- Returns:
- expression for this value after mapper has been applied
- Since:
- 3.1.0
-
asBigDecimal
Returns anToBigDecimalNullableexpression that has the value of this field but casted to aBigDecimal.- Returns:
- expression for this value after mapper has been applied
- Since:
- 3.1.0
-
mapToEnumIfPresent
default <E extends Enum<E>> com.speedment.runtime.compute.ToEnumNullable<ENTITY,E> mapToEnumIfPresent(Function<V, E> mapper, Class<E> enumClass) Returns anToEnumNullableexpression that has the value returned by the specified mapper function if the value for this field is notnull, and otherwisenull.- Type Parameters:
E- the enum type- Parameters:
mapper- the mapper operationenumClass- class of the enum to map to- Returns:
- expression for this value after mapper has been applied
- Since:
- 3.1.0
-
asEnum
default <E extends Enum<E>> com.speedment.runtime.compute.ToEnumNullable<ENTITY,E> asEnum(Class<E> enumClass) Returns anToBooleanNullableexpression that has the value of this field, casted to a particularenumclass.- Type Parameters:
E- the enum type- Parameters:
enumClass- class of the enum to map to- Returns:
- expression for this value after mapper has been applied
- Since:
- 3.1.0
-