OpenNTF / org.openntf.xsp.jakartaee

XPages Jakarta EE support libraries
Apache License 2.0
21 stars 6 forks source link

Consider customizing mechanisms for mapping view columns to entity properties #238

Open jesse-gallagher opened 2 years ago

jesse-gallagher commented 2 years ago

Currently, the @ViewEntries annotation just passes view columns on directly by programmatic name. This is okay in the normal case where the column is just the item name, or when the model object makes explicit affordances for view column names, but in practice things get hairier.

For example, in a client case, view columns are given programmatic names prefixed with “$” even when they contain a direct item - e.g. “$ProjectName”.

Additionally, this mapping may be different view to view.

It may end up making sense to have a repeatable annotation to provide entity field mappings to column names with an optional viewNames property.

jesse-gallagher commented 2 years ago

Alternatively to mapping it on the entity level, it may make more sense to have a larger customization annotation set on the querying method, listing any field mappings needed.