Quick search:


What is a multi value property

A property that returns an array of values.

The values in the array should be of the type described by the propertyDescriptor.

Multi value properties are usually used for navigating relationships. PntMultiValuePropertyDescriptor implements default behavior for navigating relationships. It looks for a property whose name is the lcFirst of the class of it's own peanut extended with 'Id'. Then it retrieves a peanut with the value of that property equal to the id of its own peanut's id through the classDescriptor of the type. If this is a PntDbClassDescriptor this will retrieve an array of peanuts from the database. Since version 1.2 PntMultiValuePropertyDescriptor cache the objects that where retrieved in a field on the peanut.

Since version 1.2 multi value properties also support navigation and modification in n to m relationships. This requires the navigationPath to be set to a path referring another multi value property, and from its type, a derived property navigating an n to 1 relationship. Both properties must be persistent. The multi value propertyDescriptor will then perform a query JOINing the table of the first properties type. See how to add relationship navigation.

Property getters may override all this.

Properties navigating an M to N relationship can be edited by an MtoNPropertyPage. This page alows the user to remove values and add values through search and selection. The result is submitted at once and processed by a SaveAction. Ids of added and removed values are passed to a method <propertyName>MtoNmodIds, or if the method does not exist, to the propertyDescriptor. See example 13.