4 Replies Latest reply on Feb 10, 2010 2:50 AM by Midhun Agnihotram

    org.hibernate.MappingException: Type not supported: org.hibernate.type.TimestampType

    Andy Stone Newbie

      HI,

       

      I am geting the following exception on trying to start an application.

       

      Caused by: org.hibernate.MappingException: Type not supported: org.hibernate.type.TimestampType
          at org.hibernate.envers.configuration.metadata.IdMetadataGenerator.addIdProperties(IdMetadataGenerator.java:71)
          at org.hibernate.envers.configuration.metadata.IdMetadataGenerator.addId(IdMetadataGenerator.java:107)
          at org.hibernate.envers.configuration.metadata.AuditMetadataGenerator.generateFirstPass(AuditMetadataGenerator.java:380)
          at org.hibernate.envers.configuration.EntitiesConfigurator.configure(EntitiesConfigurator.java:102)
          at org.hibernate.envers.configuration.AuditConfiguration.<init>(AuditConfiguration.java:86)
          at org.hibernate.envers.configuration.AuditConfiguration.getFor(AuditConfiguration.java:99)
          at org.hibernate.envers.event.AuditEventListener.initialize(AuditEventListener.java:315)
          at org.hibernate.event.EventListeners$1.processListener(EventListeners.java:198)

       

      This appears to be because there is a temporal attribute in the primary key.  The reason for a temporal attribute in the primary key is that I am actually using a view.  When generating entities from the view, becuase hibernate cannot determine a primary key, it puts all attributes in the primary key.

       

      In order to recreate the stack fragment shown above, all you have to do is add the two attached classes to a project that has some envers enabled tables:


      Thanks in advance for any help.

       

      Cheers,

              Andy.