1 Reply Latest reply on Jan 4, 2007 9:24 PM by dslevine

    HibernateLongInstance Object Persistance basic question, how

    dslevine Newbie

      Cuddled up so warm in my office at 2am between XMas and NYE, full of holiday cheer!! Happy (almost) New Year everyone! =)

      I am adding a Hibernate variable to the contextInstance, and would like for it to persist with the HibernateLongInstance:

      HibernateLongInstance (this is used for hibernatable types with a long id field. One java.lang.Object field is mapped as a reference to a hibernate entity in the database)

      But instead of matching the HibernateLongIdMatcher, my hibernate classes are matching the SerializableMatcher. I dont see the Test case doing any special declaration anywhere, so I assume it looks it up by the Hibernate metadata. Or... Should I have to register my Hibernate classes somewhere explicitly?

      I saw Tom's JIRA issue: http://preview.tinyurl.com/y6kn4e But that is not what my problem is.

      I know it is something very basic, and i've reread the docs and looked at the test cases and searched the forums. Harumph. ?

      Thanks! I'll post the answer here if I figure it out...

        • 1. Re: HibernateLongInstance Object Persistance basic question,
          dslevine Newbie

          Problem solved. I am an idiot and didnt read the docs properly at 2am.

          (Answer for anyone else trying to figure this out is to override the org/jbpm/context/exe/jbpm.varmapping.xml file with your own jbpm.varmapping.xml in the classpath.)

          However, I am surprised that it doesn't automatically read the hibernate cfg and use the HibernateLongInstance or HibernateStringInstance as a default for any Hibernate object with a Long or String key.

          For the moment, I'll just add creation of the jbpm.varmapping.xml file to the script that builds my POJOs from Hibernate configs, but I could work on a patch for auto-detecting if others agree this should be default behavior.

          Happy New Year!