hibernate - Getting changes in one column of an historical table -


I have a table that stores historical data. It is mapped to one unit with the following areas (I use JPA with Hibernate implementation):

  @Antity @Table (name = "items_historical") Public class ItemHistory {Private Intex ID; Private date; @Enumerated (EnumType.ORDINAL) Private StatusEnum status @ManyToOne (optional = false) Personal user user; @ManyToOne (optional = false) Private items item; } Public enum StatusEnum {OK, Bad, ... // my status}  

On every line I store historical data from another table. I need to get a list of changes on the "Status" column: the status, date, and previous position of a particular item (this situation will be fine and the situation will change when the situation is changed). I do not know if this is possible by using HQL.

Thank you.

Instead of designing a custom solution why do not you use a solution for historical data (before Is known as Jebos Enars)? I think you will find the features of Envers quite compelling.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -