• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

many-to-one create query execution

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
eg
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
 
He was expelled for perverse baking experiments. This tiny ad is a model student:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic