表 customer(company_code varchar(10),customer_id varchar(10));
其主键是company_code 和customer_id 复合主键
表 Order(company_code,order_id,customer_id)
其中company_code 和order_id 是复合主键,company_code 和customer_id 引用cusotmer
我用的是 hibernate3 的annotations作为映射的,由myeclipse平台插件生成
但是在插入order时,会发现hibernate生成的insert sql中没有customer_id,因此customer_id的值总是空值,尽管你的PO Order中有值。
@ManyToOne(fetch=FetchType.LAZY)
@JoinColumns( {
@JoinColumn(name="COMPANY_CODE", referencedColumnName="COMPANY_CODE", nullable=false, insertable=false, updatable=false),
@JoinColumn(name="CUSTOMER_ID", referencedColumnName="CUST_CODE", nullable=false, insertable=false, updatable=false) } )
后来我将以上的insertable改成true
出现:Mixing insertable and non insertable columns in a property is not allowed
目前解决办法是在Order中再添加一个property:customerId
private String customerId;
@Column(name="CUSTOMER_ID", length=10)
public String getCustomerId() {
return customerId;
}
public void setCustomerId(String customerId){
this.customerId=customerId;
}
insertabel还是复原
这样能解决问题,但不是好的方式。
分享到:
相关推荐
《Handbook of Industrial Mixing - Science and Practice》(工业混合手册:科学与实践)是一本由Edward L. Paul、Victor A. Atiemo-Obeng和Suzanne M. Kresta共同编辑的专业书籍。本书旨在为读者提供工业混合领域...
We added three new chapters: Chapter 22 on monotone chains, Chapter 23 on the exclusion process, and Chapter 24 that relates mixing times and hitting time parameters to stationary stopping times....
Thus the subject is the concern of geophysical and environmental scientists (in dealing with atmospheric jet streams, ocean currents, and the flow of rivers, for example), of astrophysicists (in ...
可以使用`value`关键字创建值类型,或者使用`__declspec(property)`和`[FieldOffset]`等特性来控制内存布局和封送行为。 ```cpp // 定义一个需要封送的结构体 [StructLayout(LayoutKind::Sequential)] value struct...
Newman撰写的一篇经典论文,该文深入探讨了网络中顶点(节点)之间的连接模式,特别是它们倾向于与其他具有相似或不相似特征的顶点相连接的现象,即所谓的“同质性混合”(assortative mixing)。Newman在这篇文章...
.NET Reactor is a powerful .NET code protection & licensing system which assists developers in protecting their .NET software. Developers are able to protect their software in a safe and simple way ...
The main objective of this paper is to increase the complexity by novel schemes of mixing (reversible cellular automata) RCA and (non-uniform reversible cellular automata) NRCA. We apply set of ...
### 混合使用 JSTL 和 JSF 在 Web 应用中的应用 #### 引言 在 Java Web 开发领域,JavaServer Pages Standard Tag Library (JSTL) 和 JavaServer Faces (JSF) 是两种非常重要的技术。尽管这两种技术在功能上存在很...
本压缩包文件“Survey Image Mixing and Deleting for Data Augmentation.zip”包含了一份详细探讨这一主题的PDF报告,主要关注了两种数据增强策略:图像混合(Image Mixing)和图像删除(Image Deleting)。...
外来植物薇甘菊入侵的凋落物混合分解效应研究,陈宝明,彭少麟,不同植物的凋落物混合后会产生混合分解效应,也称作非加和效应(non-additive effects),有的研究发现不同植物的凋落物混合后会产生正分�
数据增强在深度神经网络性能提升方面扮演了重要角色。该技术通过各种手段,如dropout、正则化和图像增强,防止过拟合并提高模型的泛化能力。图像混合和删除是数据增强的一个子领域,它包括两种主要操作:一是将两张...
爱因斯坦凝聚中的自旋运动,张文献,Bo Sun,We propose to localize spin mixing dynamics in a spin-1 Bose-Einstein condensate by a temporal modulation of spin exchange interaction, which is tunable with ...
We study the co-existing four-wave mixing (FWM) process with two dressing fields and the six-wave mixing (SWM) process with one dressing field in a five-level system with carefully arranged laser ...
JDK 7 is a superset of JRE 7, and contains everything that is in JRE 7, plus tools such as the compilers and debuggers necessary for developing applets and applications. JRE 7 provides the libraries, ...
We experimentally demonstrate high-efficiency and broadband four-wave mixing in a silicon-graphene strip waveguide. A four-wave mixing conversion efficiency of ?38.7 dB and a 3-dB conversion bandwidth...
By itself it is a non-unique matrix factorization problem while unique solutions can be ob-tained by imposing additional assumptions such as statistical indepen-dence. By mapping the matrix data to a...