【发布时间】:2011-08-08 20:10:20
【问题描述】:
我正在尝试使用最新的 hibernate 创建一个基本的 hibernate 实体 POJO,并且我已经添加了我从 hibernate 网站下载的必要 jar 文件。
问题是当我添加行@Table(name = "user")
它抱怨编译错误:
注解@Table 必须定义 属性applyTo
完整代码如下:
package com.jr.entities.users;
import java.io.Serializable;
import org.hibernate.annotations.Entity;
import org.hibernate.annotations.Table;
@Entity
@Table(name = "user")
public class DAOuser implements Serializable{
private String uid;
private String emailAddress;
private String username;
private String password;
}
在此示例链接http://www.roseindia.net/hibernate/hibernateannotations/hibernate-annotations-tutorial.shtml 中,它表示不需要设置 applyTo 值?我错过了什么吗?如果有帮助,我在 eclipse J2ee 中创建了一个简单的 EJB3 项目。
提前致谢
【问题讨论】: