休息 api spring
Rest api spring
我正在休息 api 通过 spring。
我在 isdeleted
中有一个字段 table 我需要在 mysql 中查找 isdeleted =0
然后它会在 [=24= 中的行中显示数据] 以及在应用程序列表中,但如果 isdeleted=1
,数据保留在数据库中的 table 中,但未显示在软删除的应用程序列表中,我如何在存储库文件中实现此条件使用 findall()
方法
public interface FoodCourtRepository extends JpaRepository<FoodCourtEntity, Long> {
List<FoodCourtEntity> findAll(isdeleted=false???);
}
只需将以下方法添加到您的接口存储库中:
List<FoodCourtEntity> findByDeleted(boolean isDeleted);
您可以了解更多
Spring Data JPA documentation
我正在休息 api 通过 spring。
我在 isdeleted
中有一个字段 table 我需要在 mysql 中查找 isdeleted =0
然后它会在 [=24= 中的行中显示数据] 以及在应用程序列表中,但如果 isdeleted=1
,数据保留在数据库中的 table 中,但未显示在软删除的应用程序列表中,我如何在存储库文件中实现此条件使用 findall()
方法
public interface FoodCourtRepository extends JpaRepository<FoodCourtEntity, Long> {
List<FoodCourtEntity> findAll(isdeleted=false???);
}
只需将以下方法添加到您的接口存储库中:
List<FoodCourtEntity> findByDeleted(boolean isDeleted);
您可以了解更多 Spring Data JPA documentation