-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: @onetomany not updating
PostPosted: Thu May 14, 2009 7:10 pm 
Beginner
Beginner

Joined: Tue Aug 21, 2007 4:58 am
Posts: 30
Hi,
I have a relationship manytoone like this:

Periodo---manytoone->dia----manytoone--->horario

when I save periodo, dia and horario do not save, and it does not throw and exception, it just doesn´t save.
this is my code:

In periodo class:

@OneToMany(fetch = FetchType.LAZY, mappedBy = "periodo", cascade=CascadeType.ALL)
@OrderBy("dia ASC")
public Set<Dia> getDias() {
return this.dias;
}

In Dia clasS:

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "periodo", nullable = false)
@NotNull
public Periodo getPeriodo() {
return this.periodo;
}

@OneToMany(fetch = FetchType.LAZY, mappedBy = "dia")
@OrderBy("inicio ASC")
public Set<Horario> getHorarios() {
return this.horarios;
}


in horario class:

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "dia", nullable = false, insertable=true, updatable=true)
@NotNull
public Dia getDia() {
return this.dia;
}



Any ideas??


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.