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: Resposible in saving object in database using hibernate
PostPosted: Thu Sep 04, 2008 12:58 am 
Newbie

Joined: Thu Aug 14, 2008 10:25 am
Posts: 1
Hello guys,

I'm newbie hibernate user, I want to create conditional logic in MyObjectManagerImpl.java saveMyObject() method when it is true, i won't save the object in the database and throw error message else i will call myObjectDao.saveMyObject(myObject); in MyObjectDaoHibernate.java in order to save it to database. That is the usual process, but im encountering problem even my Manager saveMyObject in MyObjectManagerImpl is empty it still save the object into database without calling the MyObjectDaoHibernate saveMyObject method.

Below is the code



public interface MyObjectManager {
public void saveMyObject(MyObject myObject);
}

///////////////////
public class MyObjectManagerImpl extends BaseManager implements MyObjectManager {

public void saveMyObject(MyObject myObject) {
myObjectDao.saveMyObject(myObject);

}

}
///////////////
public class MyObjectHibernate extends BaseDaoHibernate implements MyObject {

public void saveMyObject(MyObject myObject) {
getHibernateTemplate().saveOrUpdate(screener);
}

}

thanks in advanced


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.