Ticket #93 (new task)

Opened 8 years ago

Last modified 7 years ago

Repository.update: allow to specify which fields should be present in the returned Record object

Reported by: bruno Owned by: evert
Priority: major Milestone:
Component: Repository Version:
Keywords: Cc: lily-developers@…

Description (last modified by bruno) (diff)

Right now the fields that will be in the returned Record object are those which were specified in the (partial) update.

However, it is not because a user updated just some fields that he does not want a full or different partial view of the record returned. While one could do a second read for that, the record might have been changed in the meantime, hence not corresponding anymore to the updates the user did.

Therefore, I would suggest we let the repository.update() method behave in the same way as the read method: by default return the full record, and also allow to specify a list of qnames. Maybe it also makes sense to have an option to return no fields at all (if the update was successful, the fields should have the value you submitted), or only the submitted fields (current behavior, maybe not so interesting, but if you have a huge amount of fields this could be a more interesting default).

Change History

comment:1 Changed 8 years ago by bruno

BTW, same should be done for repository.create()

comment:2 Changed 8 years ago by evert

  • Milestone changed from 0.2 to 0.3

comment:3 Changed 8 years ago by evert

  • Milestone changed from 0.3 to ~1.0

comment:4 Changed 8 years ago by bruno

Just to be explicit, this should also work for updateMutableFields.

Related to this: system fields like the record types should also be completed in the returned record object. Currently the behavior depends on whether there are any changed fields. Since as client you don't know this, you can't rely on the record type information in the returned record object (it might be there, it might not be there), and hence the only reliable thing to do is to read the record again.

comment:5 Changed 8 years ago by bruno

Somewhat related: Record.getRecordType(scope) should specify what is returned if there are no versioned or versioned-mutable fields.

comment:6 Changed 8 years ago by bruno

More thoughts: if I do an update of versioned-mutable fields, but there are also versioned and non-versioned fields in the supplied record object, will those be present in the returned record object? What would expect here?

comment:7 Changed 8 years ago by bruno

  • Description modified (diff)

comment:8 Changed 8 years ago by bruno

#96 is related to this (API to specify what fields to return)

comment:9 Changed 7 years ago by evert

  • Milestone changed from 1.0 to 1.1

comment:10 Changed 7 years ago by bruno

In [4848]:

Make sure the returned record object after a repository.update() always contains the actual record type information corresponding to the repository state, also for scopes that were not modified. Came across this by a NPE in the REST itf when doing an update operation twice (= unchanged record on second operation).
This is slightly related to re #93, which is about copying stuff from originalRecord.

comment:11 Changed 7 years ago by bruno

  • Milestone 1.1 deleted
Note: See TracTickets for help on using tickets.