openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pinaki Poddar <>
Subject Re: NPE on ManyToOne while using insertable = false, updatable = false
Date Wed, 02 Jan 2008 21:11:58 GMT

OpenJPA (or for that matter anyone other than the designer) has no way to
know that  
private Integer cdProduto;
refers to the primary key of the field
private Produto produto;//read only

You have tell that to OpenJPA.

So what you can do (if the design insist on a arguably erroneous domain
model for all the wrong reasons) to maintain referential integrity is:

public Item(....,Produto p) {
  this.cdProduto = p.getCdProduto();
  this.produto = p;

View this message in context:
Sent from the OpenJPA Users mailing list archive at

View raw message