-->
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: How to access the system generating INTERMEDIATE tables..
PostPosted: Tue May 31, 2011 3:18 am 
Newbie

Joined: Thu Nov 11, 2010 5:45 am
Posts: 4
I'm new to hibernate and JPA...In my project i'm using @OneToMany , @ManyToOne and also @ManyToMany relationships..There are properly annotated and also working correctly..Now problem is raising while i try to delete the associated objects..

Before deleting any object i nullify the reference of that object in all tables..i implement this using searchString of id in all objects..i feel it's better to search via intermediate table mainly in ManyToMany relationships...

i use objects as follows..
Left Object:

@ManyToMany(mappedBy = "leftManies")
private Set<RightMany> rightManies = new HashSet<RightMany>();

RightObject:
@ManyToMany
@JoinTable(name = "LeftRight")
private Set<LeftMany> leftManies = new HashSet<LeftMany>();

And in query i use...
String hql = "select LeftRight";
Query query = session.createQuery(hql);
in console the table is correctly creating in the name of LeftRight...but i unable to access that table.This query is not working..

Any idea to access intermediate table...?

Thanks in advance..


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.