hibernate配置映射的问题

今日工作内容:用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层的修改。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值