5 Replies Latest reply on Mar 30, 2010 7:10 AM by Donovan De Beuckelaer

    @Type ignored?

    Donovan De Beuckelaer Novice

      I'm having a problem mapping a custom type with envers. I hope i forgot something.

       

       

      When i add "@NotAudited" to amount, everything works perfect.

       

       

      @Column(precision = 6, scale = 2)
      @Type(type="syndicus.domain.util.EuroType")
      private Euro amount = new Euro();
      
      

       

      When i merge, following exception occure

       

      java.lang.ClassCastException: syndicus.domain.util.Euro
           at org.hibernate.type.DoubleType.set(DoubleType.java:60)
           at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:154)
           at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:131)
           at org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:2015)
           at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2261)
           at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2678)
           at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:79)
           at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)
           at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)
           at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:167)
           at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
           at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50)
           at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1028)
           at org.hibernate.envers.synchronization.AuditSync.beforeCompletion(AuditSync.java:161)
           at org.hibernate.transaction.JDBCTransaction.notifyLocalSynchsBeforeTransactionCompletion(JDBCTransaction.java:274)
           at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:140)
           at org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:54)
           at org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:456)
           at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:732)
           at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:701)
           at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:321)
           at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116)
           at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
           at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
           at $Proxy37.merge(Unknown Source)