Package com.onec.ui

Record Class RelatedList

java.lang.Object
java.lang.Record
com.onec.ui.RelatedList
Record Components:
name - the panel id (unique per entity) and the REST sub-path segment
joinCatalog - the junction class whose rows model the relationship — a @Catalog or an @InformationRegister
via - field name of the Ref on the junction that scopes rows to this record (the back-reference to the owning catalog/document)
display - field name of the Ref on the junction shown and picked per row (resolved to its description); also the add-row picker's target
columns - junction field names to render as columns; empty means just display
label - panel heading; blank means derive one from name
hideInDetail - when true, the panel renders only in the edit form, not in the read/detail view; defaults to false so a declared panel shows in both

public record RelatedList(String name, Class<?> joinCatalog, String via, String display, List<String> columns, String label, boolean hideInDetail) extends Record
A declarative related-list (inline child rows) panel for a catalog or document view, backed by a junction — a join catalog or an information register — rather than an owned tabular section. It gives many-to-many relationships the same inline ergonomics that @TabularSection gives documents, while keeping a single source of truth: the junction rows themselves. Both sides of the relationship can mount a panel against the same junction, so a Booking document and a Client catalog each show "their" rows with no mirroring.

Authored on EntityView.fields(com.onec.ui.EntityConfigBuilder) via EntityConfigBuilder.relatedList(String, Class):

 // In ClinicView.fields(...)
 f.relatedList("doctors", ClinicDoctor.class)
     .via("clinic")        // the Ref<Clinic> that scopes rows to this record
     .display("doctor")    // the Ref<Doctor> shown / picked per row
     .columns("doctor");   // optional extra junction columns (defaults to the display ref)
 

This is view-only configuration — it adds no tables and changes no schema. The panel reads live from the junction (rows where via points at the current record). A join-catalog junction is editable: add/remove create/deletion-mark join rows, reusing the existing Ref picker and the join catalog's @AccessControl write roles. An information-register junction (1C's idiomatic M:N store — two ref dimensions) is rendered read-only for now, since information registers have no generic write REST surface yet.

  • Constructor Details

    • RelatedList

      public RelatedList(String name, Class<?> joinCatalog, String via, String display, List<String> columns, String label, boolean hideInDetail)
      Creates an instance of a RelatedList record class.
      Parameters:
      name - the value for the name record component
      joinCatalog - the value for the joinCatalog record component
      via - the value for the via record component
      display - the value for the display record component
      columns - the value for the columns record component
      label - the value for the label record component
      hideInDetail - the value for the hideInDetail record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • joinCatalog

      public Class<?> joinCatalog()
      Returns the value of the joinCatalog record component.
      Returns:
      the value of the joinCatalog record component
    • via

      public String via()
      Returns the value of the via record component.
      Returns:
      the value of the via record component
    • display

      public String display()
      Returns the value of the display record component.
      Returns:
      the value of the display record component
    • columns

      public List<String> columns()
      Returns the value of the columns record component.
      Returns:
      the value of the columns record component
    • label

      public String label()
      Returns the value of the label record component.
      Returns:
      the value of the label record component
    • hideInDetail

      public boolean hideInDetail()
      Returns the value of the hideInDetail record component.
      Returns:
      the value of the hideInDetail record component