To better understand, which is my problem, I attached an image to explain.
I have three entities: Object, History and History Stations
I want to create a history of an object, which gets some data from the entity objects (where all objects are stored) and from another entity, called history stations, where every record represents a different date range an local, where the object has been from date 1 until date 2, then from date 2 to date 3 and so on.
The history stations may consist of two, three or more records and the links are displayed in the entity history.
The relationship between history and history stations is a n:n.
Every history should exist only once, thus the relationship between objects and history is one-to-one
This all works, as desired but has one problem. If I choose from history one object, that had been choosen before already, the first history with the same object will be destroyed and all history stations of that history become orphans.
How can I avoid, that you cannot choose an object again, which already has a history created?
I have three entities: Object, History and History Stations
I want to create a history of an object, which gets some data from the entity objects (where all objects are stored) and from another entity, called history stations, where every record represents a different date range an local, where the object has been from date 1 until date 2, then from date 2 to date 3 and so on.
The history stations may consist of two, three or more records and the links are displayed in the entity history.
The relationship between history and history stations is a n:n.
Every history should exist only once, thus the relationship between objects and history is one-to-one
This all works, as desired but has one problem. If I choose from history one object, that had been choosen before already, the first history with the same object will be destroyed and all history stations of that history become orphans.
How can I avoid, that you cannot choose an object again, which already has a history created?
Comment