-->
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.  [ 3 posts ] 
Author Message
 Post subject: A bug in the delete with entity-name?
PostPosted: Thu May 12, 2005 2:38 pm 
Newbie

Joined: Tue Feb 08, 2005 6:16 pm
Posts: 5
Hi, I am using Hibernate 3.02 with entity-name feature. However, when I tried to delete an object: session.delete(target), where the target is the object to be deleted, it complaines unknown entity. I looked around and foudn a delete method in SessionImpl class: delete(String entityname, Object obj, boolean iscCascadeDeleteEnabled). I then used this delete. It seems working fine.

Is this a mismatch between Session interface and SessionImpl? How do a delete an object with an entity-name specified? Thanks.


Top
 Profile  
 
 Post subject: Re: A bug in the delete with entity-name?
PostPosted: Thu May 12, 2005 3:22 pm 
Expert
Expert

Joined: Mon Feb 14, 2005 12:32 pm
Posts: 609
Location: Atlanta, GA - USA
yufeng wrote:
Hi, I am using Hibernate 3.02 with entity-name feature. However, when I tried to delete an object: session.delete(target), where the target is the object to be deleted, it complaines unknown entity. I looked around and foudn a delete method in SessionImpl class: delete(String entityname, Object obj, boolean iscCascadeDeleteEnabled). I then used this delete. It seems working fine.

Is this a mismatch between Session interface and SessionImpl? How do a delete an object with an entity-name specified? Thanks.


I use session.delete(obj) quite frequently without any issues.

Is the Class of your target object above the same as the one your specifying for the entityname or is it a sub/super class ?

As with most of hibernate, it allows you to specify minimal information and determines the rest for you when possible. But if your class is a subclass that's not mapped, it'll work if you specify the superclass as the entity name, but not if you enter the subcass name.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 12, 2005 5:18 pm 
Newbie

Joined: Tue Feb 08, 2005 6:16 pm
Posts: 5
session.save, session.update, session.get all have methods which support entity-name, only session.delete does not. It seems a bit odd. If I simply create a new Object and set the Identifer (a trnasitent object), the session.delete without an entity-name cannot help me locate the correct table to delete the object since I have several tables mapped to the same class. The only difference is the entity-name.


Also, in my application, session.save, session.update, session.get all work. Seems it should not be the xml mapping problem.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.