[ https://issues.apache.org/jira/browse/CAUSEWAY-3772?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andi Huber updated CAUSEWAY-3772: --------------------------------- Fix Version/s: 3.1.0 > Sorting on a collection of view models, hitting hollow exception > ---------------------------------------------------------------- > > Key: CAUSEWAY-3772 > URL: https://issues.apache.org/jira/browse/CAUSEWAY-3772 > Project: Causeway > Issue Type: Bug > Components: Viewer Wicket > Affects Versions: 2.0.0 > Reporter: Daniel Keir Haywood > Assignee: Andi Huber > Priority: Major > Fix For: 2.1.0, 3.1.0 > > Attachments: stacktrace-3772.txt > > > InvoiceSummary is an entity > > Its collection of getInvoices is a repository query: > @Collection > public List<InvoiceForLease> getInvoices() { > return invoiceForLeaseRepository.find....(); > } > > Its collection "invoicesDocsFra" is derived, returning view model for each > entity. > > public class InvoiceSummary_invoiceDocsFra { > private final InvoiceSummary invoiceSummary; > public List<DocAndCommFra> coll() { > return invoiceSummary.streamInvoices() > .map(docAndCommFactory::instantiate) > .collect(Collectors.toList()); > } > } > > the DocAndCommFra is a view model that wraps each invoice: > @Named(DocAndCommFra.LOGICAL_TYPE_NAMED) > @DomainObject(nature = Nature.VIEW_MODEL) > @DomainObjectLayout > @NoArgsConstructor > @AllArgsConstructor(access = AccessLevel.PACKAGE) > public final class DocAndCommFra { > public static final String LOGICAL_TYPE_NAMED = > "outgoing.invoiceforlease.DocAndCommFra"; > @Property > @PropertyLayout(sequence = "1") > @Getter @Setter > private InvoiceForLease invoice; > @Property > @PropertyLayout(sequence = "1.3") > public Lease getLease() { > return getInvoice().getLease(); > } > @Property() > @PropertyLayout(sequence = "1.4") > public CommunicationChannel getSendTo() { > return getInvoice().getSendTo(); > } > ... > } > > it's possible to sort the "docAndCommsFra" table on invoice, and on lease, > but not on sendTo. Note that CommunicationChannel is abstract, subtypes are > either EmailAddress or PostalAddress. > [^stacktrace-3772.txt] -- This message was sent by Atlassian Jira (v8.20.10#820010)