Project

General

Profile

Actions

bug #9081

closed

Handle empty Partials correctly

Added by Andreas Müller over 2 years ago. Updated over 2 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 #1

Updated by Andreas Müller over 2 years ago

Actions #2

Updated by Andreas Müller over 2 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 50
Actions #3

Updated by Andreas Müller over 2 years ago

  • Assignee changed from Andreas Müller to Katja Luther

should be fixed. Please review.

Actions #4

Updated by Andreas Müller over 2 years ago

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

Updated by Katja Luther over 2 years 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.

Actions #6

Updated by Andreas Müller over 2 years ago

Actions #7

Updated by Andreas Müller over 2 years ago

Actions

Also available in: Atom PDF