【问题标题】:JPA 2.1 says attribute "indexes is undefined"JPA 2.1 说属性“索引未定义”
【发布时间】:2014-11-14 09:51:54
【问题描述】:

我目前正在开发一个使用 Wildfly 8.0.0 和 Hibernate JPA 2.1 的网络应用程序。 我的问题是,我无法用索引注释 ManyToOne。

import javax.persistence.Cacheable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Index;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import de.sessions.benutzerverwaltung.domain.Benutzer;

@Entity
@Table(indexes = { @Index(columnList = "user_fk"), @Index(columnList = "session_fk") })
@Cacheable
public class Comment implements Serializable{
...

Eclipse 说“注释类型表的属性索引未定义” 在另一个项目中它工作得很好。

提前致谢, 蒂姆

【问题讨论】:

  • 我的错误显示这似乎是 eclipse 是类加载 JPA2.0 而不是 2.1 - 值得检查

标签: java jpa indexing undefined wildfly


【解决方案1】:

通过删除类并创建新类(Ctrl+ACtrl+CCtrl+V)和问题解决了失去了。日食....

【讨论】:

    猜你喜欢
    • 2019-09-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多