bug #9081
closedHandle empty Partials correctly
50%
Description
Currently empty partials are stored as "00000000" in the database. This results in a situation where an hql query like "WHERE ... .timePriod = (null-object) ..." will result in an SQL "WHERE ... .timePeriod.start IS NULL" . So it will not return a record while there is an existing record.
A reason why there might be such empty timeperiods might be that in Peson class the get and set method for lifespan creates such empty Paritals if lifespan is null
public TimePeriod getLifespan(){ if(lifespan == null) { this.lifespan = TimePeriod.NewInstance(new Partial(), new Partial()); } return this.lifespan; }
The Reference class does not do such things for Reference.datePublished so it does not seem to be necessary and removing the above code may solve the problem somehow.
However, solving it by handling empty Partials as null might be the better solution as it will give a consistent handling of TimePeriod and Partial independent on the correct handling of these 2 classes.
We may also need an update script to adapt old existing data to the new handling.
Related issues