Problem : There is a transaction table and status table with one-to-many mapping. One transaction can have multiple statuses like failed, partially paid and success. How to fetch the latest status of a transaction.
ie, If I have a transaction with multiple statuses like failed and success of which success is the latest one. Is there any way to configure the same in hibernate to fetch one record from status table based on date field or any other field?
I have been searching for best way for my problem, though I have some ways to do the same using comparable and compare to in java, I am still wondering if there is any solution that hibernate provides where we can simply configure it in hbm files and get the output.
Thanks in advance.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.