Results 1 to 3 of 3

Thread: Spring Data JPA and checking old state

  1. #1
    Join Date
    Oct 2011
    Posts
    25

    Default Spring Data JPA and checking old state

    I've got a mini-workflow system on an entity. call it Order. Order has the states DRAFT, SUBMITTED, PAID, SHIPPED.

    I'm currently using Spring Data JPA over Hibernate. Is there a way to figure out in (for example) a @PreUpdate callback, what the old state is, so I can perhaps kick off a JMS message?

    I've looked at Hibernate Envers, but that doesn't do it for me, because I don't actually need auditing. The standard @PreUpdate does not give the old state. Is there some other option? Surely other people has run into this type requirement before, but Stack Overflow and Google are strangely silent on solutions...

    thanks
    Jeff

  2. #2
    Join Date
    Aug 2006
    Posts
    130

    Default

    using hibernate envers, you can check with the historyreader exactly which values changed and send an event

  3. #3
    Join Date
    Oct 2011
    Posts
    25

    Default

    I'd really rather not use Envers. I don't actually need auditing. and the creation and storage of these audit entries. I just need a pre-state and a post-state so I can kick off events. Envers seems to be quite a bit of overkill for what I'm trying to do...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •