Linen CRUD = Products CRUD Mapper lib: https://mapstruct.org (models, streams(!))
.roles("ADMIN") => @Secured("ROLE_ADMIN")
Drop h2 with
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD)
!!! Test with posgreSQL !!!
Cross usage of mappers:
@Mapper(componentModel = "spring", uses = ProductMapper.class)
NB: make recheck what intellij automatically imports (toList)
liquidbase columns -> https://docs.liquibase.com/change-types/community/add-column.html
Problem with swagger and multipart upload :( In postman it should be formdata with key-value
Validate API requires implementation: validation-api + hibernate-validator
Right file upload: FileImportControllerTest.postFile() => requires all headers, content dispositions and so on, and so on
findByName
=> Optional
getByName
=> Product
https://www.baeldung.com/spring-data-derived-queries
interface JpaRepo {
List<User> findByAgeGreaterThan(Integer age);
List<User> findByAgeGreaterThanEqual(Integer age);
List<User> findByNameOrderByName(String name);
List<User> findByNameOrderByNameAsc(String name);
List<User> findTop3ByAge();
Stream<Product> findAllByImagesIsEmpty();
}