Module org.simpleflatmapper.jdbc
Package org.simpleflatmapper.jdbc
Class DiscriminatorJdbcBuilder<T>
java.lang.Object
org.simpleflatmapper.jdbc.DiscriminatorJdbcBuilder<T>
- Type Parameters:
T- the root type of the jdbcMapper
The builder is used to build a DiscriminatorMapper that will instantiate
different types depending on the value of a specified field.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionDiscriminatorJdbcBuilder(String column, JdbcMapperFactory jdbcMapperFactory) -
Method Summary
Modifier and TypeMethodDescriptionmapper()Add a discriminator value with its associated class.Add a discriminator value with its associated type.Add a discriminator value with its associated type specified by the type reference.Add a discriminator matching predicate with its associated type.
-
Constructor Details
-
DiscriminatorJdbcBuilder
-
-
Method Details
-
when
Add a discriminator value with its associated type.- Parameters:
value- the valuetype- the type- Returns:
- the current builder
-
when
public DiscriminatorJdbcBuilder<T>.DiscriminatorJdbcSubBuilder when(org.simpleflatmapper.util.Predicate<String> predicate, Type type) Add a discriminator matching predicate with its associated type.- Parameters:
predicate- the predicatetype- the type- Returns:
- the current builder
-
when
public DiscriminatorJdbcBuilder<T>.DiscriminatorJdbcSubBuilder when(String value, Class<? extends T> type) Add a discriminator value with its associated class.- Parameters:
value- the valuetype- the class- Returns:
- the current builder
-
when
public DiscriminatorJdbcBuilder<T>.DiscriminatorJdbcSubBuilder when(String value, org.simpleflatmapper.util.TypeReference<? extends T> type) Add a discriminator value with its associated type specified by the type reference.- Parameters:
value- the valuetype- the type reference- Returns:
- the current builder
-
mapper
- Returns:
- a new jdbcMapper based on the current state
-