• Post Reply Bookmark Topic Watch Topic
  • New Topic

many-to-one create query execution  RSS feed

bhaveshs shah
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,

I have issue regarding many-to-one query execution as a result, all the queries are executed 3 times of related parent object(Sevicegroup) when it is fired.
private String Fetch_Qry ="select * from service where ....."
Session session = sessionFactory.getCurrentSession();
List<SeviceDomain> result = session.createQuery(Fetch_Qry).list();

hibernate mapping
<many-to-one name="SeviceDomain" class="Sevicegroup" column="serviceid" cascade="all" not-null="true" />

a) class Sevicegroup is parent class
b) class SeviceDomain is Arry(inside Sevicegroup ) example (Application--> Applicant[]...)

issue Whenevever the create query is executed , Sevicegroup releated query is also exected , Sevicegroup releated queries is exected thrice .

i require to execute the single query result of create not the Sevicegroup related queries.
please suggest

Thanks & regards
Bhavesh Shah
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!