yes, associating a time to entitymanager is a good approach, but remember that sometimes you just want to look to some data in past, and everything can be in present, like "customer: - last year my contract was this way, then changed twice, I want to go back to my old contract". both features are ok. AFAIK toplink has both. anyway, the "selected automatically" part is not simple. ;-) every relatioship must be historical and means you will need a join table to do it. some constrains cant be forced, like the historical id, you cant say it will be unique, because it will have duplicates.
[]s, gandhi 2007/5/21, Craig L Russell <[EMAIL PROTECTED]>:
As I've had it explained to me, you would not choose the time in a user-generated or user-visible query. Instead, the user would set the time and associate it with an EntityManager. The time is invisible to normal entity operations, including queries. For each query for a temporal object (the terminology I've heard) the EntityManager would include the appropriate WHERE clauses into the SQL that would select the proper instances based on the time. So a find by primary key, navigation, or query would have the appropriate WHERE clauses generated with no action on the part of the user. In the example below, the A instance doesn't need to worry about which B it refers to, because the B instances corresponding to A's time are also selected automatically, in that both A and B have corresponding temporal WHERE clauses based on the same time. Craig On May 21, 2007, at 3:16 PM, Ricardo Andere de Mello wrote: > yes.... this look something simple, but it is not... > see, objects exists in time, so for example, they are not deleted, > they are > "finalized". > the worst part are the relationships, because they are historical > too... > basically you have a start and end date for that object, and the > object with > end date null is the actual object. > everytime you modify an object you clone it, set the end date of > the old, > and set the start date of the new. > imagine now that "A" points to "B". both are historical objects. if > "B" is > modified, a new historical object is created. "A" should point to > the new > "B", not the old one. so you must have a "historical id" or a > "historical id > object" to point at, that is common to all "B". > > []s, gandhi > > 2007/5/21, Marc Prud'hommeaux <[EMAIL PROTECTED]>: >> >> >> Something like: "select x from Employee x as x was on January 1, >> 2002" >> >> >> >> On May 21, 2007, at 11:01 AM, Kevin Sutter wrote: >> >> > Sorry to show my ignorance, but what are "historical objects"? >> > Thanks! >> > >> > Kevin >> > >> > On 5/18/07, Ricardo Andere de Mello <[EMAIL PROTECTED]> wrote: >> >> >> >> ok, I'm sending this message to netmind list too, so they can >> >> answer my >> >> next >> >> question too: >> >> >> >> * Maybe this is a silly question, but is it possible to place >> >> netmind's >> >> beankeeper historical structure between OpenJPA and the database >> >> backstore? >> >> >> >> I dont think *any* serious commercial application can avoid >> >> historical >> >> objects. >> >> I think netmind's beankeeper is a great thing, and JPA is a good >> >> standard. >> >> Mixing both projects would be very cool. ;-) >> >> >> >> []s, gandhi >> >> >> >> >> >> 2007/5/18, Marc Prud'hommeaux <[EMAIL PROTECTED]>: >> >> > >> >> > >> >> > Sadly, no. We don't have any built-in support for historical >> >> support >> >> > at this time, although we have thought for a long time that this >> >> > would be a great feature to have. >> >> > >> >> > You can, of course, do it yourself manually with a bunch of >> >> > persistent Date fields, but I agree that this is pretty >> >> cumbersome to >> >> > have to manage yourself. >> >> > >> >> > >> >> > >> >> > On May 18, 2007, at 11:27 AM, Ricardo Andere de Mello wrote: >> >> > >> >> > > Does OpenJPA have something similar to TopLink's >> "AsOfClause" ? >> >> > > >> >> > > I've been working for some time with OJB and Hibernate, and >> I'm >> >> > > work a lot >> >> > > with historical objects. >> >> > > It really sucks to manage lots of classes to build a >> historical >> >> > > structure of >> >> > > objects and object relations. >> >> > > >> >> > > Netminds beankeeper does a great job about this, but I'd >> like to >> >> > > adhere to >> >> > > JPA... >> >> > > >> >> > > Any idea of implementing historical objects AND RELATIONS, >> >> inside JPA? >> >> > > >> >> > > -- >> >> > > Ricardo Andere de Mello >> >> > > Presidente do Quilombo Digital >> >> > > 55 (11) 3271-7928 / 55 (11) 9917-7722 >> >> > >> >> > >> >> >> >> >> >> -- >> >> Ricardo Andere de Mello >> >> Presidente do Quilombo Digital >> >> 55 (11) 3271-7928 / 55 (11) 9917-7722 >> >> >> >> > > > -- > Ricardo Andere de Mello > Presidente do Quilombo Digital > 55 (11) 3271-7928 / 55 (11) 9917-7722 Craig Russell Architect, Sun Java Enterprise System http://java.sun.com/products/jdo 408 276-5638 mailto:[EMAIL PROTECTED] P.S. A good JDO? O, Gasp!
-- Ricardo Andere de Mello Presidente do Quilombo Digital 55 (11) 3271-7928 / 55 (11) 9917-7722