【发布时间】:2019-07-11 04:58:34
【问题描述】:
我正在与 Jhipster 合作。我无法懒惰地吸引客户。
我已经制作了这样的 JDL...
PROPERTY
id
...
CUSTOMER
id
...
CUSTOMER_PROPERTY
id
customer_id
property_id
value
relationship OneToMany {
Customer to CustomerProperty
}
relationship ManyToOne {
CustomerProperty to Property
}
我的域名
客户.java
@OneToMany(mappedBy = "customer", fetch = FetchType.LAZY)
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
private Set<CustomerProperty> customerProperties = new HashSet<>();
属性.java 没有映射
CustomerProperty.java
@ManyToOne
private Property property;
@ManyToOne
@JsonIgnoreProperties("customerProperties")
private Customer customer;
我已经尝试显式设置 fetch = FetchType.LAZY,但它不断将完整的 Customer 对象与所有 CustomerProperties 列表一起提供
我想了解为什么 fetch 不起作用
【问题讨论】:
标签: java database hibernate jpa persistence