我有一个包含两个字段的抽象类 AbstractEntity:
- 上次编辑时间(本地日期时间)
- 最后编辑用户(用户实体)
下面是代码:
@MappedSuperclass
public abstract class AbstractEntity {
protected LocalDateTime lastEditTime;
protected UserEntity lastEditUser;
protected AbstractEntity () { }
protected AbstractEntity (UserEntity creatorUser) {
lastEditTime = LocalDateTime.now();
lastEditUser = creatorUser;
}
public LocalDateTime getLastEditTime() {
return lastEditTime;
}
public void setLastEditTime(LocalDateTime lastEditTime) {
this.lastEditTime = lastEditTime;
}
public UserEntity getLastEditUser() {
return lastEditUser;
}
public void setLastEditUser(UserEntity lastEditUser) {
this.lastEditUser = lastEditUser;
}
}
然后我有具有许多不同字段的 UserEntity 类:
@Entity
@Table(name = "Users")
public class UserEntity extends AbstractEntity {
@Id
private String name;
private String password;
...
}
Eclipse 显示以下错误消息:
在隐含关联覆盖“lastEditUser”中,无法在表“users”上解析连接列“lastEditUser_name”
这是什么意思?我该如何解决?
谢谢!