bug #9081
Handle 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
Associated revisions
fix #9081 fix handling of empty Partial during save and in Person.get/setLifespan
fix #9081 cleaning up tests using "00000000"
fix #9081 cleaning up tests using "00000000" (cont.)
fix #9081 cleaning up tests using "00000000" (cont. 2)
History
#1 Updated by Andreas Müller 10 months ago
- Blocks feature request #9078: Handle name parsing and deduplication on server side added
#2 Updated by Andreas Müller 10 months ago
- Status changed from New to Resolved
- % Done changed from 0 to 50
Applied in changeset cdmlib|15f01b88c23a2d398aaa3dda81f0a6954a57da64.
#3 Updated by Andreas Müller 10 months ago
- Assignee changed from Andreas Müller to Katja Luther
should be fixed. Please review.
#4 Updated by Andreas Müller 10 months ago
- Precedes task #9082: Update script for old empty Partials handling added
#5 Updated by Katja Luther 10 months ago
- Status changed from Resolved to Closed
- Assignee changed from Katja Luther to Andreas Müller
the code looks good and the tests work as expected, so we can close this ticket.
#6 Updated by Andreas Müller 10 months ago
- Related to feature request #9085: Improve deduplication of parsed names added
#7 Updated by Andreas Müller 10 months ago
- Blocks deleted (feature request #9078: Handle name parsing and deduplication on server side)