Ticket #788 (closed Defect: fixed)

Opened 7 years ago

Last modified 7 years ago

Core API: ChildTopics manipulators doesn't work for "many" childs

Reported by: jri Owned by: jri
Priority: Major Milestone: Release 4.6
Component: DeepaMehta Standard Distribution Version: 4.5
Keywords: Cc: dgf, Malte
Complexity: 3 Area: Application Framework / API
Module: deepamehta-core

Description

When one of the manipulator methods is called on a ChildTopics object when the child is defined as many an exception is thrown, basically:

java.lang.RuntimeException: Invalid access to ChildTopicsModel entry "dm4.test.child": the caller assumes it to be multiple-value but it is single-value in {...}

These ChildTopics methods are affected:

set()
setRef()
remove()

Note: the Webclient handles models which include many relationships properly. Affected are 3rd-party applications (and/or migrations) which operate on a ChildTopics object directly. As a workaround create a ChildTopicsModel yourself and call the object's generic update() method.

Change History

comment:1 Changed 7 years ago by jri

  • Status changed from new to accepted

comment:2 Changed 7 years ago by Jörg Richter <jri@…>

In ca317c3d2b1fce76c097447d9d99da9c3c14eadd/deepamehta:

Add test to demonstrate issue #788.

See #788.

comment:3 Changed 7 years ago by Jörg Richter <jri@…>

In 39f02dec76cce65bce6f32d7b41b0b1da28db4ac/deepamehta:

Core: add ChildTopics? "many" manipulators (#788).

CHANGES

Core API:

The ChildTopics interface has new methods to manipulate child topics which have an underlying "many" relationship:

add()
addRef()
addDeletionRef()

Note: for "one" relationships the corresponding methods are:

set()
setRef()
setDeletionRef()

IMPORTANT: to manipulate "one" or "many" child topics you must use the set and add methods repectively. When you try e.g. to manipulate child topics which have an underlying "many" relationship with the set methods, an exception is thrown.

For the first time you can manipulate "many" child topics directly via the ChildTopics object.

BREAKING CHANGES

1 method renamed in ChildTopics:

remove() -> setDeletionRef()

See #788.

comment:4 Changed 7 years ago by jri

  • Status changed from accepted to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.