Hi folks,

Just wanted to let you know of a small but useful enhancement as to how the
Wicket viewer renders parented tables.

To explain (and this is taken from the ticket, [1]):

~~~
Suppose we have a bidirectional many:many, eg Customer <->* CustomerAddress
*<-> Address.

The CustomerAddress "link" entity has references back to both Customer and
Address.

When viewing the Customer, we would like the parented table showing the
addresses collection (of CustomerAddress) to show the Address property of
the CustomerAddress but not to show the parent Customer property.

Conversely, when viewing the Address, we would like the parented table
showing the customers collection (of CustomerAddress) to show the Customer
property of the CustomerAddress but not to show the parent Address property.

In other words, what is shown in the table takes into account the context
in which it is shown.

~~~
This has been implemented by extend the @Hidden annotation's Where enum.
 Specifically:

public class CustomerAddress {

    @Hidden(where = Where.REFERENCES_PARENT)
    private Customer customer;

    @Hidden(where = Where.REFERENCES_PARENT)
    private Address address;

    ...
}

~~~
The long-and-short of it is that any "foreign key" properties should
typically have this annotation.

Dan

[1] https://issues.apache.org/jira/browse/ISIS-344

Reply via email to