这个错误org.hibernate.MappingException: Unknown entity: cn.com.sgcc.iss.model.TempAt

chaizhilei123 2013-12-07 01:50:07
我用的注解的方式,为什么还报错。。和配置文件有关系吗?

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

@Entity
@Table(name="iss_tmp_attackqs_com")
@SequenceGenerator(name="seq_tmp_attackqs_com",sequenceName="seq_tmp_attackqs_com",allocationSize=1)
public class TempAttackTide {

/**
* @ID
*/
private int id;

/**
* @指标一级分类
*/
private String onetype;

/**
* @指标二级分类
*/
private String twotype;

/**
* @组织机构id
*/
private int orgId;

/**
* @指标名称
*/
private String name;

/**
* @指标值value
*/
private String value;

/**
* @更新时间
*/
private Date occurTime;

public int getId() {
return id;
}
@Id
@GeneratedValue(generator="seq_tmp_attackqs_com",strategy = GenerationType.SEQUENCE)
public void setId(int id) {
this.id = id;
}

public String getOnetype() {
return onetype;
}

public void setOnetype(String onetype) {
this.onetype = onetype;
}

public String getTwotype() {
return twotype;
}

public void setTwotype(String twotype) {
this.twotype = twotype;
}

public int getOrgId() {
return orgId;
}

public void setOrgId(int orgId) {
this.orgId = orgId;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public String getValue() {
return value;
}

public void setValue(String value) {
this.value = value;
}

public Date getOccurTime() {
return occurTime;
}

public void setOccurTime(Date occurTime) {
this.occurTime = occurTime;
}
...全文
201 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
姜小白- 2013-12-07
  • 打赏
  • 举报
回复
之前在ejb中用注解做持久化关联,hibernate的注解木有用过,hibernate就知道配置文件映射。
chaizhilei123 2013-12-07
  • 打赏
  • 举报
回复
还是自己找到了,少了map映射!!傻逼了

81,090

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧