-->
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: [color=orange]Hibernate Interceptor OnFlush Dirty Problem...
PostPosted: Sat Feb 03, 2007 6:02 am 
Newbie

Joined: Sat Feb 03, 2007 5:01 am
Posts: 2
Location: Chennai
Updation Problem in Interceptor.

Here is the Scenario.

1. When Updating Value in the Interceptor, The Values are not updated in the database.



This is what My Implementation.

2. OnFlushDirty Method Code.

public boolean onFlushDirty(Object entity,Serializable id,Object[] currentState,Object[] previousState,String[] propertyNames,Type[] types) {
auditingInfo.setLastUpdatedBy(userID);
auditingInfo.setDateLastUpdated(getGMTDate());


}


DAOIMPL Method.

public void updateCustomFieldSet(Pojo pojo) {

getHibernateTemplate().update(pojo) ;


logger.info("------------------ AFTER -- Created By-------------------- : " + pojo.getCreatedBy());
logger.info("------------------ AFTER -- Created Date-------------------- : "+ pojo.getDateCreated());
logger.info("------------------- AFTER -- Last Updated By-------------------- : "+ pojo.getLastUpdatedBy());
logger.info("------------------- AFTER -- Last Updated Date-------------------- : "+ pojo.getDateLastUpdated());



}


This is the Out put in the TomCat Server After Updation.

------------------ AFTER -- Created By-------------------- : null
------------------ AFTER -- Created Date-------------------- : null
------------------- AFTER -- Last Updated By-------------------- : 3
------------------- AFTER -- Last Updated Date-------------------- : Sat Feb 03 08:39:54 IST 2007



But, The Database is not getting Updated by this Value.



Kindly Clarify

_________________
Sundararaman.V.S.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 03, 2007 6:21 am 
Senior
Senior

Joined: Tue Aug 23, 2005 8:52 am
Posts: 181
How do you get the auditingInfo object? By Casting from the method argument for onFlushDirty?
Also do you return true or false from onFlushDirty?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 03, 2007 6:26 am 
Newbie

Joined: Sat Feb 03, 2007 5:01 am
Posts: 2
Location: Chennai
rajasaur wrote:
How do you get the auditingInfo object? By Casting from the method argument for onFlushDirty?
Also do you return true or false from onFlushDirty?




AuditingInfo Is an Interface, Which contains 4 Methods,

Created By, Created Date, Last Updated By, Last Updated Date. Which is Implemented in All the Bean.



In OnFlush Dirty, The Value is setting for AudtingInfo which is implemented in all the Beans.



2. In Onflush Dirty, The Return type -- We made it has "FALSE"


Kindly reply,
Sundararaman.V.S.

_________________
Sundararaman.V.S.


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.