persistence@glassfish.java.net

What is wrong in this relationship?

From: Franzisk <francisco.vieira.souza_at_gmail.com>
Date: Tue, 8 Dec 2009 06:33:18 -0800 (PST)

I have these two Entities, Parametro and TabelaIR, Parametro can have lots of
TabelaIR, so I have a 1xN.

In Parametro.java I have:
    @OneToMany(cascade = {CascadeType.ALL}, mappedBy = "parametro", fetch =
FetchType.LAZY, targetEntity = TabelaIR.class)
    @JoinColumn(name = "ID_PARAMETRO")
    public Collection<TabelaIR> getTabelasIR() {
        return tabelasIR;
    }

In TabelaIR.java I have:
    @ManyToOne(cascade = {CascadeType.ALL})
    @JoinColumn(name = "ID_PARAMETRO", nullable = false)
    public Parametro getParametro() {
        return parametro;
    }

The problem is: when persisting the ID_PARAMETRO column in TABELA_IR table
is not being saved, it should be set with the ID of of the PARAMETRO table.

What is wrong with my ralationship?
-- 
View this message in context: http://old.nabble.com/What-is-wrong-in-this-relationship--tp26694802p26694802.html
Sent from the java.net - glassfish persistence mailing list archive at Nabble.com.