2 Replies Latest reply on Oct 15, 2005 6:05 PM by Jurica Ursic

    Entities and temporal data/relationships

    Jurica Ursic Newbie

      I would be grateful if someone could comment on what would be correct approach to modelling temporal data/relations in entities.

      For example, let us consider an entity Employee which has a relation with an entity Department. This is a ManyToOne relationship. One employee can at one time be only in one department but one department can have many employees.

      The problem is how to record the history of this association using EJB3.0 entities. An employee E1 can be in department D1 from date DATE1 to DATE2 and than move on to department D2 from DATE3. If soeone wants to know historical information about employee E1 he needs to know the periods he belonged to particular departments.

      The same problem appears with data, for example employee salary. It would be interesting to know how his salary changed historically.

      Could please someone provide some idea on how to solve this problem in the EJB entities context?