ENTITY
- the entity typeD
- the database typeE
- the java enum typeFK
- the foreign key entity typepublic interface EnumForeignKeyField<ENTITY,D,E extends Enum<E>,FK> extends EnumField<ENTITY,D,E>, HasNullableFinder<ENTITY,FK>
Enum
value in the entity that has a finder to
another entity.Modifier and Type | Method and Description |
---|---|
static <ENTITY,D,E extends Enum<E>,FK> |
create(ColumnIdentifier<ENTITY> identifier,
ReferenceGetter<ENTITY,E> getter,
ReferenceSetter<ENTITY,E> setter,
TypeMapper<D,E> typeMapper,
HasComparableOperators<FK,E> referenced,
Function<E,String> enumToString,
Function<String,E> stringToEnum,
Class<E> enumClass)
Create a new instance of this interface using the default implementation.
|
Function<E,String> |
enumToString()
A method that takes an enum and converts it into a
String . |
Function<String,E> |
stringToEnum()
A method that takes a
String and converts it into an enum for
this field. |
EnumForeignKeyField<ENTITY,D,E,FK> |
tableAlias(String tableAlias)
Creates and returns a new Field with the provided
tableAlias . |
apply, between, between, constants, create, enumClass, equal, greaterOrEqual, greaterThan, isNotNull, isNull, lessOrEqual, lessThan, mapToDoubleIfPresent, notBetween, notBetween, notEqual
create
asBigDecimal, asBoolean, asByte, asChar, asDouble, asEnum, asFloat, asInt, asLong, asShort, asString, mapToBigDecimalIfPresent, mapToBooleanIfPresent, mapToByteIfPresent, mapToCharIfPresent, mapToEnumIfPresent, mapToFloatIfPresent, mapToIntIfPresent, mapToLongIfPresent, mapToShortIfPresent, mapToStringIfPresent
get, getter, set, setter, setTo, typeMapper
isUnique, tableAlias
findColumn, identifier
between, between, comparator, comparatorNullFieldsFirst, equal, greaterOrEqual, greaterThan, in, in, lessOrEqual, lessThan, notBetween, notBetween, notEqual, notIn, notIn, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
compare
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reverseOrder
contains, containsIgnoreCase, endsWith, endsWithIgnoreCase, equalIgnoreCase, isEmpty, isNotEmpty, notContains, notContainsIgnoreCase, notEndsWith, notEndsWithIgnoreCase, notEqualIgnoreCase, notStartsWith, notStartsWithIgnoreCase, startsWith, startsWithIgnoreCase
asName, asOrdinal, compare, compose, expressionType, hash, mapIfPresent, of, orElse, orElseGet, orThrow
isNotNull, isNull
nullableFinder
backwardFinder, finder, getReferencedField
EnumForeignKeyField<ENTITY,D,E,FK> tableAlias(String tableAlias)
Field
tableAlias
. The new Field
will retain all other properties from this field except the tableAlias.tableAlias
in interface ComparableField<ENTITY,D,E extends Enum<E>>
tableAlias
in interface EnumField<ENTITY,D,E extends Enum<E>>
tableAlias
in interface Field<ENTITY>
tableAlias
in interface ReferenceField<ENTITY,D,E extends Enum<E>>
tableAlias
- the table alias to use in the new fieldtableAlias
Function<String,E> stringToEnum()
String
and converts it into an enum for
this field.
The function should return null
if a null
value is
specified as input and throw an exception if the value is invalid.
Function<E,String> enumToString()
String
.
The function should return null
if a null
value is
specified as input and throw an exception if the value is invalid.
static <ENTITY,D,E extends Enum<E>,FK> EnumForeignKeyField<ENTITY,D,E,FK> create(ColumnIdentifier<ENTITY> identifier, ReferenceGetter<ENTITY,E> getter, ReferenceSetter<ENTITY,E> setter, TypeMapper<D,E> typeMapper, HasComparableOperators<FK,E> referenced, Function<E,String> enumToString, Function<String,E> stringToEnum, Class<E> enumClass)
ENTITY
- the entity typeD
- the database typeE
- the java enum typeFK
- the foreign key entity 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 appliedreferenced
- the field in the foreign entity that is referencedenumToString
- method to convert enum to a stringstringToEnum
- method to convert a string to enumenumClass
- the enum classCopyright © 2019 Speedment, Inc.. All rights reserved.