Project

General

Profile

bug #9081

Handle empty Partials correctly

Added by Andreas Müller about 2 months ago. Updated about 2 months ago.

Status:
Closed
Priority:
New
Category:
cdmlib
Target version:
Start date:
06/18/2020
Due date:
% Done:

50%

Severity:
normal
Found in Version:

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

Related to Edit - feature request #9085: Improve deduplication of parsed names Closed 06/19/2020
Precedes Edit - task #9082: Update script for old empty Partials handling In Progress 06/19/2020

Associated revisions

Revision 15f01b88 (diff)
Added by Andreas Müller about 2 months ago

fix #9081 fix handling of empty Partial during save and in Person.get/setLifespan

Revision 4c4faa00 (diff)
Added by Andreas Müller about 2 months ago

fix #9081 cleaning up tests using "00000000"

Revision 60e7f76c (diff)
Added by Andreas Müller about 2 months ago

fix #9081 cleaning up tests using "00000000" (cont.)

Revision f7d4f55f (diff)
Added by Andreas Müller about 2 months ago

fix #9081 cleaning up tests using "00000000" (cont. 2)

History

#1 Updated by Andreas Müller about 2 months ago

#2 Updated by Andreas Müller about 2 months ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 50

#3 Updated by Andreas Müller about 2 months ago

  • Assignee changed from Andreas Müller to Katja Luther

should be fixed. Please review.

#4 Updated by Andreas Müller about 2 months ago

  • Precedes task #9082: Update script for old empty Partials handling added

#5 Updated by Katja Luther about 2 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 about 2 months ago

#7 Updated by Andreas Müller about 2 months ago

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 40 MB)