Project

General

Profile

Actions

bug #9081

closed

Handle empty Partials correctly

Added by Andreas Müller almost 4 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
New
Category:
cdmlib
Target version:
Start date:
Due date:
% Done:

50%

Estimated time:
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 namesClosedAndreas Müller

Actions
Precedes EDIT - task #9082: Update script for old empty Partials handlingClosedAndreas Müller

Actions
Actions

Also available in: Atom PDF