Record Class OneToOneProcessor
java.lang.Object
java.lang.Record
io.github.joselion.springr2dbcrelationships.processors.OneToOneProcessor
- Record Components:
template- the r2dbc entity templateentity- the processed field entitytable- the processed field entity tablecontext- the Spring application context
- All Implemented Interfaces:
Processable<OneToOne,Object>
public record OneToOneProcessor(org.springframework.data.r2dbc.core.R2dbcEntityTemplate template, Object entity, org.springframework.data.relational.core.sql.SqlIdentifier table, org.springframework.context.ApplicationContext context)
extends Record
implements Processable<OneToOne,Object>
The
OneToOne annotation processor.-
Constructor Summary
ConstructorsConstructorDescriptionOneToOneProcessor(org.springframework.data.r2dbc.core.R2dbcEntityTemplate template, Object entity, org.springframework.data.relational.core.sql.SqlIdentifier table, org.springframework.context.ApplicationContext context) Creates an instance of aOneToOneProcessorrecord class. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.context.ApplicationContextcontext()Returns the value of thecontextrecord component.entity()Returns the value of theentityrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisBackReference(OneToOne annotation, Field field) Whether the annotated field is in the backreference side of the relationship or not.isBackReference(Field field) Curried version ofisBackReference(OneToOne, Field)method.reactor.core.publisher.Mono<Object> Persists the value of a field annotated with a relationship annotation.reactor.core.publisher.Mono<Object> Returns aMonocontaining the value used to populate a field annotated with a relationship annotation.org.springframework.data.relational.core.sql.SqlIdentifiertable()Returns the value of thetablerecord component.org.springframework.data.r2dbc.core.R2dbcEntityTemplatetemplate()Returns the value of thetemplaterecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.github.joselion.springr2dbcrelationships.processors.Processable
columnNameOf, columnNameOrNull, createdColumnOf, createdColumnOf, domainFor, idColumnOf, idValueOf, inferForeignField, inferForeignField, isNew, persist, populate, save, tableIdentifierOf, tableNameOf
-
Constructor Details
-
OneToOneProcessor
public OneToOneProcessor(org.springframework.data.r2dbc.core.R2dbcEntityTemplate template, Object entity, org.springframework.data.relational.core.sql.SqlIdentifier table, org.springframework.context.ApplicationContext context) Creates an instance of aOneToOneProcessorrecord class.
-
-
Method Details
-
populate
Description copied from interface:ProcessableReturns aMonocontaining the value used to populate a field annotated with a relationship annotation.- Specified by:
populatein interfaceProcessable<OneToOne,Object> - Parameters:
annotation- the field's annotation instancefield- the field to be populated- Returns:
- a publisher containing the value to populate
-
persist
Description copied from interface:ProcessablePersists the value of a field annotated with a relationship annotation. Then returns aMonocontaining the result of the operation.- Specified by:
persistin interfaceProcessable<OneToOne,Object> - Parameters:
annotation- the field's annotation instancefield- the field to be persisted- Returns:
- a publisher containing the value os the persist operation
-
isBackReference
-
isBackReference
Curried version ofisBackReference(OneToOne, Field)method.- Parameters:
field- field the annotated field- Returns:
trueif the field is a backreference,falseotherwise
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
template
-
entity
-
table
-
context
-