Interface Processable<T extends Annotation,U>
- Type Parameters:
T- the type of the processed annotationU- the type of value populated or persisted
- All Known Implementing Classes:
ManyToManyProcessor,ManyToOneProcessor,OneToManyProcessor,OneToOneProcessor
public interface Processable<T extends Annotation,U>
Describes how a relationship annotation is processed.
-
Method Summary
Modifier and TypeMethodDescriptiondefault StringcolumnNameOf(Field field) Returns the column name representation of a field.default @Nullable StringcolumnNameOrNull(Field field) Returns the column name representation of a field or null if the persistent property does not exist.org.springframework.context.ApplicationContextcontext()Returns the Spring application context.createdColumnOf(Class<?> type) Returns anOptionalcontaining the auditable column used to mark the date of creation or empty.createdColumnOf(S target) Returns anOptionalcontaining the auditable column used to mark the date of creation or empty.default <S> Class<?> Returns the actual domain of an entity which may or may not be projected by another type.entity()Returns the entity where the annotated field is being processed.default StringidColumnOf(Class<?> type) Returns the primary key column name of an entity type.default @Nullable ObjectReturns the primary key value of an entity if exists, otherwisenull.inferForeignField(String foreignKey) Tries to infer the foreign key field in the current entity type.inferForeignField(String foreignKey, Class<?> entityType) Tries to infer the foreign key field in the specified entity type.default booleanReturnstrueif the entity is considered to be new,falseotherwise.Curried version ofpersist(Annotation, Field)method.reactor.core.publisher.Mono<U> Persists the value of a field annotated with a relationship annotation.Curried version ofpopulate(Annotation, Field)method.reactor.core.publisher.Mono<U> Returns aMonocontaining the value used to populate a field annotated with a relationship annotation.default <S,I> reactor.core.publisher.Mono <S> save(S entity) Inserts an entity when it's new or update it otherwise.org.springframework.data.relational.core.sql.SqlIdentifiertable()Returns the SQL identifier of the table associated with the entity where the annotated field is being processed.default org.springframework.data.relational.core.sql.SqlIdentifiertableIdentifierOf(Class<?> type) Returns the tableSqlIdentifierof an entity type.default StringtableNameOf(Class<?> type) Returns the table name of an entity type.org.springframework.data.r2dbc.core.R2dbcEntityTemplatetemplate()Returns the r2dbc entity template injected to the processor.
-
Method Details
-
populate
Returns aMonocontaining the value used to populate a field annotated with a relationship annotation.- Parameters:
annotation- the field's annotation instancefield- the field to be populated- Returns:
- a publisher containing the value to populate
-
populate
Curried version ofpopulate(Annotation, Field)method.- Parameters:
field- field the field to be populated- Returns:
- a function taht takes the annotation
Tand returns a publisher containing the value to populate
-
persist
Persists the value of a field annotated with a relationship annotation. Then returns aMonocontaining the result of the operation.- Parameters:
annotation- the field's annotation instancefield- the field to be persisted- Returns:
- a publisher containing the value os the persist operation
-
persist
Curried version ofpersist(Annotation, Field)method.- Parameters:
field- the field to be persisted- Returns:
- a function that takes the annotation
Tand returns a publisher containing the value os the persist operation
-
template
org.springframework.data.r2dbc.core.R2dbcEntityTemplate template()Returns the r2dbc entity template injected to the processor.- Returns:
- the r2dbc entity template
-
entity
Object entity()Returns the entity where the annotated field is being processed.- Returns:
- the field's entity
-
table
org.springframework.data.relational.core.sql.SqlIdentifier table()Returns the SQL identifier of the table associated with the entity where the annotated field is being processed.- Returns:
- the entity's table SQL identifier
-
context
org.springframework.context.ApplicationContext context()Returns the Spring application context.- Returns:
- the application context
-
isNew
Returnstrueif the entity is considered to be new,falseotherwise.- Parameters:
entity- the entity to check if it's new- Returns:
- true if the entity is new, false otherwise
-
save
default <S,I> reactor.core.publisher.Mono<S> save(S entity) Inserts an entity when it's new or update it otherwise.- Type Parameters:
S- the entity typeI- the type of the entity identifier- Parameters:
entity- the entity to insert/update- Returns:
- a publisher containing the inserted/updated entity
-
domainFor
-
tableIdentifierOf
Returns the tableSqlIdentifierof an entity type.- Parameters:
type- the type of the entity- Returns:
- the table identifier
-
tableNameOf
-
idColumnOf
-
idValueOf
-
createdColumnOf
-
createdColumnOf
Returns anOptionalcontaining the auditable column used to mark the date of creation or empty.- Type Parameters:
S- the type of the target- Parameters:
target- the target to find the field- Returns:
- an optional with the creation date column or empty
-
columnNameOf
-
columnNameOrNull
-
inferForeignField
-
inferForeignField
-