MyBatis Plus: Retrieve All Data

There are two ways to retrieve all data using MyBatis Plus:

The first method: querying all data using the selectList method

List<Entity> list = mapper.selectList(null);

The second option: using the selectList method with a Wrapper object to retrieve all data.

List<Entity> list = mapper.selectList(new QueryWrapper<>());

Entity is the class corresponding to the data table, while mapper is the interface corresponding to the data table.

Both methods will retrieve all the data from the data table and return the results in the form of a List.

bannerAds