【发布时间】:2017-08-08 08:09:05
【问题描述】:
在 Repositories 中的 Rest Spring API 中,我需要通过三个参数查找值,但即电话、密码、查找 delete=0 查找依据。我已经将它添加到实体中,但它显示错误无效派生查询!找不到类型 CustomerEntity 的属性被删除!两个字段工作正常,但 is-deleted 不起作用
@Repository
public interface CustomerRepository extends JpaRepository<CustomerEntity, Long> {
CustomerEntity findByfacebookID(String facebookID);
CustomerEntity findByPhoneAndPasswordAndIsDeleted(String phone, String password, Boolean isdeleted);
实体
@Entity
@Table(name = "CUSTOMER")
public class CustomerEntity {
@Column(name = "IS_DELETED", length = 3, nullable = false)
private Boolean isdeleted;
【问题讨论】:
-
为什么属性名称中有空格?正好在
private Boolean is deleted
标签: java spring rest spring-data-jpa