Spring Boot JPA object by reference

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/suo082407128/article/details/97380329

Some pit encountered in the use of JPA in the process, save () method during the Update operation when, null property is also updated to the database, check a lot of information, solutions are not perfect, might as well write your own update statement, write update when you do not want to write long way parameter passing objects directly how good, check the information online to find a lot of programs are not correct, they finally find a positive solution on the stack, where the next record, and facilitate the later students detours

@Query("select u from User u where u.firstname = :#{#customer.firstname}")
List<User> findUsersByCustomersFirstname(@Param("customer") Customer customer);

 

Guess you like

Origin blog.csdn.net/suo082407128/article/details/97380329