-->
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.  [ 4 posts ] 
Author Message
 Post subject: Session.get()
PostPosted: Sat Apr 13, 2013 6:14 am 
Newbie

Joined: Fri Apr 12, 2013 1:53 am
Posts: 18
The following is a line of code in an Application class. Employee is the POJO class. We are detecting a particular employee to be deleted using the EmployeeID. Is it possible to delete the whole schema of that particular employee only through knowing the employeeID? Here, employeeID is generated id.
All in all - what does session.get() does?
Employee employee =(Employee)session.get(Employee.class, EmployeeID);
session.delete(employee);


Top
 Profile  
 
 Post subject: Re: Session.get()
PostPosted: Sat Apr 13, 2013 6:56 am 
Regular
Regular

Joined: Wed Apr 10, 2013 1:02 am
Posts: 50
Deleting whole schema i would suppose you mean to say like employee has some other components inside the employee class like address and when u want to delete the employee it should get deleted too?

_________________
Regards
Akash Miital
http://akash.thegrassroots.co.in/hibernate/


Top
 Profile  
 
 Post subject: Re: Session.get()
PostPosted: Sat Apr 13, 2013 11:34 am 
Newbie

Joined: Fri Apr 12, 2013 1:53 am
Posts: 18
yes


Top
 Profile  
 
 Post subject: Re: Session.get()
PostPosted: Sat Apr 13, 2013 11:41 am 
Regular
Regular

Joined: Wed Apr 10, 2013 1:02 am
Posts: 50
You can use Cascade

_________________
Regards
Akash Miital
http://akash.thegrassroots.co.in/hibernate/


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

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.