Questions tagged [bidirectional-relation]

98 questions
0
votes
2 answers

Hibernate: bi-directional mapping OneToMany does not work

I have three classes as following: import java.sql.Timestamp; import java.util.List; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.EnumType; import…
LAC
  • 852
  • 4
  • 11
  • 31
0
votes
1 answer

Should I update bidirectional relation also in Java?

Suppose I have User and Group entities and wish them to have 1 to many relationship between. I.e. each User belongs to one Group, while any Group can contain many Users. Group entity: @Entity @Table(name="GroupTable") public class Group { @Id …
0
votes
1 answer

How do I setup a bi-directional relationship in Hibernate (3.2)?

I'm having trouble setting up a bi-directional relationship in Hibernate (v 3.2.1.g a -- can't upgrade now). I have an object, TrainingSession, which contains many TrainingLink objects. So I have @Entity @Table(name = "cb_pd_training_session", …
Dave
  • 15,639
  • 133
  • 442
  • 830
0
votes
1 answer

Jackson One-to-One serialization

I am looking for a way in Jackson to allow serialization of a relationship depending on the root element. For example, I have a relationship that is not a true parent/child. Both entities can be queried. Address { @JsonBackReference …
SchraderMJ11
  • 613
  • 6
  • 12
0
votes
1 answer

Rails 3: Model with multiple bi-directional relationships to itself

I'm trying to build a text adventure game in Rails 3 (yes I know that's silly). Right now I have a model called Room. Each room needs to be associated with up to four other rooms. This relationship would be bi-directional, such that any two…
0
votes
1 answer

bidirectional many-to-many and DAO ended in HibernateException

I'm developing a web based database front-end for school. But I have problems with a many-to-many relationship. When I comment out it my server starts up without problems. Here's the stack trace of the start up. [java] SCHWERWIEGEND: Exception…
0
votes
1 answer

MVC3 Optional Bidirectional relationship code first

What I have is something like public class BuildingUnit { public int ID { get; set; } *irrelevant stuff removed* public virtual BuildingUnitInsurance UnitInsurance { get; set; } } public class BuildingUnitInsurance { public int ID…
-1
votes
2 answers

Does NHibernate really deliver transparent persistency

Starting to use Nhibernate for persistency being seduced by the promise that it respects your domain model, I tried to implement a relation manager for my domain objects. Basically, to DRY my code with respect to managing bidirectional one to many…
halcwb
  • 1,480
  • 1
  • 13
  • 26
1 2 3 4 5 6
7