我有一个映射两个对象的实体。将FetchType.EAGER更改为FetchType.LAZY后,编译应用程序以进行弹出
public class MessageEntity {
...
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "sender_id", nullable = false)
private UserEntity sender;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "recipient_id", nullable = false)
private UserEntity recipient;
...
}
[EL Warning]: metadata: 2017-12-19 21:00:02.847--ServerSession(123577677)--Reverting the lazy setting on the OneToOne or ManyToOne attribute [sender] for the entity class [class com.core.jpa.entity.MessageEntity] since weaving was not enabled or did not occur.
[EL Warning]: metadata: 2017-12-19 21:00:02.847--ServerSession(123577677)--Reverting the lazy setting on the OneToOne or ManyToOne attribute [recipient] for the entity class [class com.core.jpa.entity.MessageEntity] since weaving was not enabled or did not occur.
这是我对数据库的访问配置。 https://pastebin.com/uKtrseUB