1
    AuditReader reader = AuditReaderFactory.get(entityManager);
    AuditQuery query = reader.createQuery().forRevisionsOfEntityWithChanges(Customer.class, false);

    List<Object[]> revisionsCustomer = query
            .add(AuditEntity.id().eq(3014l))
            .addOrder(AuditEntity.revisionProperty("timestamp").desc())
            .getResultList();

I have edited the instance with id 3014 4 times. Each time editing a different column.

But in revisionsCustomer it shows that every time I have changed the same column (the one I have edited the last time).

Is this a bug, or I am doing something wrong?

Envers version: 5.3.20

farahm
  • 1,326
  • 6
  • 32
  • 70
  • I figured out, that the problem lies in: `.addOrder(AuditEntity.revisionProperty("timestamp").desc())`. When I comment out this line, each revision shows correctly the columns that have changed. – farahm Dec 17 '20 at 06:40
  • 1
    Hi @farahm, sorry for the late reply. Did you solve your issue? – jccampanero Dec 20 '20 at 11:40
  • Hi @jccampanero. Yes you can see my comment from before. The problem was with the addOrder function – farahm Dec 20 '20 at 11:47
  • 1
    This is nice @farahm. Sorry, in the first answer I tried to give you a general example, but perhaps for your specific use case the `addOrder` criteria is unnecessary. Having said that, I think it should have worked. Please, do not hesitate to contact me if you need further help. – jccampanero Dec 20 '20 at 11:51
  • Hi @jccampanero are you maybe available right now? – farahm Feb 22 '21 at 23:09
  • Hi @farahm. It is nice to hear from you again. It is quite late here. Do you mind if we talk tomorrow in the morning instead? I am in CET time zone. Any way, please, can you describe your problem in a comment or invite me to a chat and post it there? I will be glad to answer you if I am able to ASAP. – jccampanero Feb 22 '21 at 23:32
  • Hi @jccamanero, thanks for the reply. I have described my problem here: https://stackoverflow.com/questions/66324724/safari-set-cookies-not-working-for-first-party-cookie its about authentication cookies that i am sending to client – farahm Feb 22 '21 at 23:34
  • I will review it ASAP @farahm. As I told you, it is nice to hear from you again, I hope you are well. – jccampanero Feb 22 '21 at 23:36
  • Thank you very much. Yes I am doing fine. How about you? – farahm Feb 22 '21 at 23:37
  • 1
    I am going fine as well, thank you very much @farahm. – jccampanero Feb 22 '21 at 23:39

0 Answers0