-->
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: "Delete" (migration from hibernate2 to hibernate3 problem)
PostPosted: Thu Jul 22, 2010 3:52 am 
Newbie

Joined: Thu Jul 22, 2010 3:31 am
Posts: 1
Hello fellows.

I'm writing this post because I can't find out a solution to a problem I have recently faced up to.

I had to update the spring.jar from version 1.1 to 2.0 because the application have to recognize <import> tags.

Because of this change, I think I have to migrate from hibernate2 to hibernate3, so I changed the paths in the *DAOImpl.java from "org.springframework.orm.hibernate" to "org.springframework.orm.hibernate3" and from "net.sf.hibernate" to "org.hibernate".

The project is an Struts+Spring+Hibernate(HQL) project.

But now, once I have done all of these things, I've met up with another problem.

Things like this
Code:
public void deleteModel(Integer modelCode)
   {
      getHibernateTemplate().delete(
         "from Model model where model.code = ?",
         modelCode,
         Hibernate.INTEGER);
   }

worked perfectly on hibernate2, but with the change to hibernate3, there's no more that "delete" prototype.

All I have now is:

Code:
void delete(Object entity)


and

Code:
void delete(Object entity, Lockmode lockmode)


I don't even know how to use the "lockmode", and just wanted to know, how can I compress all the 3 parameters above to match the "entity" parameter of the new delete function.

Thanks a lot for any help.


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.