In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)06/01 Report--
I. Quick check of interface methods
The following table collates the accessible methods in simple queries, that is, the JpaRepository interface (inheriting the CrudRepository interface and the PagingAndSortingRepository interface). The main contents are as follows: (1) first, it is classified according to the function, which can be divided into five categories: save, delete, find single, find multiple, and other five categories. (2) Grey the methods that are not recommended. Most of these methods are defined in CrudRepository API and PagingAndSortingRepository API. Later, alternative methods are defined in JpaRepository API, which is more convenient to use. For example, when looking up multiple objects, it is easier to return List than Iterable.
Two and five interfaces are explained in detail
1. CrudRepository interface.
Where T is the entity class to operate on, and ID is the type of primary key of the entity class. This interface provides 11 common operation methods.
@ NoRepositoryBean public interface CrudRepository extends Repository {S save (S entity); / / Save Iterable save (Iterable entities); / / batch save T findOne (ID id); / / query an object based on id. Returns the object itself, and returns null Iterable findAll () when the object does not exist; / / queries all objects Iterable findAll (Iterable ids); / / queries all objects boolean exists (ID id) according to the id list; / / determines whether the object exists long count () according to id; / / calculates the total number of objects void delete (ID id); / / deletes void delete (T entity) based on id / / Delete an object void delete (Iterable
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.