[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-3710?page=c...
]
Anderson Teymeny commented on HHH-3710:
---------------------------------------
I think the valid time feature could solve my problem, but I was wondering if there is
another workaround for it.
Supose two entities: A and B, with A having a FK to B and both @Adudited and both with a
property named 'Name'
Here is the scenario:
day 1: the entities are inserted.
A.name = 'A1'
B.name = 'B1'
rev = 1
day 3: there is an update in B:
B.name = 'B2'
rev = 2
day 4: realize that 'A1' should be 'A2' at day 2. Then an update with the
timestamp of the REVINFO table altered to day 2
A.name = 'A2'
rev = 3
day 5: there is an update in A:
A.name = 'A3'
rev = 4
After that, if we query the table A for every single day, we got:
day 1 = 'A1'
day 2 = 'A2'
day 3 = 'A2'
day 4 = 'A2'
day 5 = 'A3'
So far so good. But, the association with B got messed up. In day 2 we should have
'A2' -> 'B1', but we got 'A2' -> 'B2'.
I see that's becouse the revision number for day 2 is 3, and quering entity B for a
revision equal or lower than 3 we got 2, which leads to the value 'B2'.
Summarizing, how can I insert a past event with envers? Does valid time really solve my
problems?
Thanks
Add Valid Time support
----------------------
Key: HHH-3710
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-3710
Project: Hibernate Core
Issue Type: Improvement
Components: envers
Affects Versions: 3.5.0.Beta-1
Reporter: jason shi
The envers uses transaction time for revisions (REVTSTMP field in REVINFO table).
For many enterprise application, the valid time is more important than the transaction
time, especially for those tables require revisions.
In the envers_seam_demo, there is a bi-temporal demo, it uses additional query conditions
(filter by actualDate),
It's too complex for us.
hope the valid time can be supported natively
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira