emmanuel wrote:
@ManyToOne(CascadeType.PERSIST)
b.setA(a);
s.persist(b)
i'm using jboss 4.04 ga... it says...
12:27:30,664 INFO  [Version] Hibernate EntityManager 3.2.0.CR1
12:27:30,680 INFO  [Version] Hibernate Annotations 3.2.0.CR1
12:27:30,696 INFO  [Environment] Hibernate 3.2 cr2
sorry i need a bit more explanation....
i have objects Gruppo, Abilitazione in many to many relations througth the object AbilitazioneGruppo..... 
a Gruppo can have zero to many AbilitazioneGruppo while AbilitazioneGruppo is linked with exactly one Gruppo and exactly one Abilitazione
with hibernate tools i got correctly that a Gruppo has Set<AbilitazioneGruppo> abilitazioneGruppos
and AbilitazioneGruppo has a Gruppo gruppo;
i try to delete an AbilitazioneGruppo from Set<AbilitazioneGruppo> abilitazioneGruppos, i see in debug that this works fine but i try to merge gruppo... but the AbilitazioneGruppo was still there!?!??
i have these annotations.... 
in Gruppo 
    @OneToMany(cascade={CascadeType.ALL}, fetch=FetchType.LAZY, mappedBy="gruppo")
    public Set<AbilitazioneGruppo> getAbilitazioneGruppos() {
       return this.abilitazioneGruppos;
    }
in AbilitazioneGruppo (i think it's here the problem)
@ManyToOne(cascade={},
        fetch=FetchType.LAZY)
    
    @JoinColumn(name="codicegruppo", unique=false, nullable=false, insertable=false, updatable=false)
    public Gruppo getGruppo() {
       return this.gruppo;
    }
i have to put @ManyToOne(CascadeType.PERSIST) in AbilitazioneGruppo for property gruppo? 
[OT] how can i get it in my entity with hibernate tools??? i made a lot of modification to template... but i think this is over my knowledge :(
thanks