-->
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: Error when implementing audit log
PostPosted: Wed Jan 04, 2006 6:45 pm 
Regular
Regular

Joined: Tue Nov 08, 2005 1:30 pm
Posts: 50
Hi I worked with audit log.. it was sucessful when i store or update i can change my audit log table. I am so happy with that..
but now the problem is i want to see the previous data of the table which i am modifying.. for that i read the artcile which is in

http://www.hibernate.org/318.html


I am so glad abt this article.. but when i implement i get an error

Code:
java.lang.ClassCastException: java.lang.Long
   at org.hibernate.type.StringType.set(StringType.java:24)
   at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:62)
   at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:44)
   at org.hibernate.loader.Loader.bindPositionalParameters(Loader.java:1115)
   at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1177)
   at org.hibernate.loader.Loader.doQuery(Loader.java:390)
   at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:218)
   at org.hibernate.loader.Loader.loadEntity(Loader.java:1345)
   at org.hibernate.loader.entity.EntityLoader.load(EntityLoader.java:116)
   at org.hibernate.loader.entity.EntityLoader.load(EntityLoader.java:101)
   at org.hibernate.persister.entity.BasicEntityPersister.load(BasicEntityPersister.java:2471)
   at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:351)
   at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:332)
   at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:113)
   at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:167)
   at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:79)
   at org.hibernate.impl.SessionImpl.get(SessionImpl.java:621)
   at org.hibernate.impl.SessionImpl.get(SessionImpl.java:614)
   at com.gehcit.ecis.pdo.audit.AuditLogInterceptor.onFlushDirty(AuditLogInterceptor.java:96)
   at org.hibernate.event.def.DefaultFlushEntityEventListener.invokeInterceptor(DefaultFlushEntityEventListener.java:212)
   at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:131)
   at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:190)
   at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:70)
   at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
   at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:730)
   at com.gehcit.ecis.pdo.CreateAudit.main(CreateAudit.java:44)


those errors are in ONFLUSHDITRY METHOD..
after


Code:
   Object preUpdateState = session.get(objectClass, persistedObjectId);


I am glad if some one helps me out..
thanks
Nag


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.