Wednesday, May 25, 2022

Spring Data VS Spring Reactive Data

 With JPA 2.2, you no longer need to use converter it added support for the mapping of the following java.time types:


CrudRepository VS ReactiveCrudRepository

PagingAndSortingRepository VS  ReactiveSortingRepository

Flux<Person> findByLastname(Mono<String> lastname);
// insert

this.repository.save(product)
              .subscribe(p -> System.out.println("After inserting : " + p));


spring-boot-starter-data-r2dbc



@EnableTransactionManagement

@EnableJpaRepositories(basePackages = "com.baeldung.spring.data.persistence.repository")


 @Transactional annotation at the class level, which is then overridden for tRhe non-read-only methods.


Exception translation is still enabled by the use of the @Repository annotation on the DAO. This annotation enables a Spring bean postprocessor to advise all @Repository beans with all the PersistenceExceptionTranslator instances found in the container, and provide exception translation just as before.

java.time.LocalDate
java.time.LocalTime
java.time.LocalDateTime
java.time.OffsetTime
java.time.OffsetDateTime
@Column(columnDefinition = "DATE")
private LocalDate date;
@Column(columnDefinition = "TIMESTAMP")
private LocalDateTime dateTime;
@Column(columnDefinition = "TIME")
private LocalTime localTime;


@GenerateValue
@GenericGenerator

@CreationTimestamp
@UpdateTimestamp

@Entity

No comments: