Uploaded image for project: 'Causeway'
  1. Causeway
  2. CAUSEWAY-3772

Sorting on a collection of view models, hitting hollow exception

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Done
    • 2.0.0
    • 2.1.0, 3.1.0
    • Viewer Wicket
    • None

    Description

      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  

      Attachments

        1. stacktrace-3772.txt
          14 kB
          Andi Huber

        Issue Links

          Activity

            People

              hobrom Andi Huber
              danhaywood Daniel Keir Haywood
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: