File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Object Relational Mapping and the fly likes Many-to-Many reading problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Many-to-Many reading problem" Watch "Many-to-Many reading problem" New topic

Many-to-Many reading problem

Carlos Conti
Ranch Hand

Joined: Apr 21, 2010
Posts: 131
Hi all again,

thanks James Sutherland for solving my issue with the writing problem. Now I cannot see why the data once it's been successfully stored in the database, why is it not being read successfully aswell? This is all driving me a bit nuts!

here's the orm.xml code piece which puts both entities into relation:

So the point is, when establishing the relationships on both sides of the object, it performs correctly, but when reading its instances it will only perform the reading from entity 'comerciales' to 'ubicaciones' but not the other way around!!!
All this many-to-many relationship gets in the end a bit tricky to manage.

Does anybody see anything wrong? EclipseLink doesn't throw anything to clue me out!

Thanks in advance for your advise.
Carlos Conti.
Carlos Conti
Ranch Hand

Joined: Apr 21, 2010
Posts: 131
Sorry folks, my fault. Within the methods responsible for maintaining coherence in the object model, I was missing unflagging listening to an event which erased the inmediate previous action. Not worth to mention anymore.

I agree. Here's the link:
subject: Many-to-Many reading problem
jQuery in Action, 3rd edition