今日工作内容:用hibernate配置映射关系。
问题:
1、@OneToOne or @ManyToOne on com.wms.model.PosDetail.position references an unknown entity: com.wms.model.Position
xml里面没有配置相对应的
<mappping class="com.wms.model.position" />
2、Repeated column in mapping for entity: com.wms.model.Stock column: depotId (should be mapped with insert="false" update="false")
出现了重复的列,导致添加失败、之前出现重复的列的时候,会提示是重复的列,然后这是提示的是个,所以没有考虑到这个问题,所以找了半天没找出来。
package com.wms.model;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;
@Entity
@Table(name="stock")
public class Stock {
@Id
@GeneratedValue(generator="mygenerator")
@GenericGenerator(name="mygenerator",strategy="uuid")
private String stockId;
private String productNum;
private String depotId;
@ManyToOne
@JoinColumn(name="productId")
private Product product;
@ManyToOne
@JoinColumn(name="depotId")
private Depot depot;
}
明日工作内容:继续完成DAO层的修改。