Announcement Announcement Module
Collapse
No announcement yet.
Maintaining order on field set Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Maintaining order on field set

    Adding a field set to an entity is fine for storing an unordered group of related entities.
    But suppose you'd like those related entities to maintain an order, like a java.util.List would.
    What's the recommended way of achieving this using Roo?

    Thanks

    Duncan.

  • #2
    We generally don't encourage the use of ordered collections due to the complexities it causes at an ORM level. Still, you can probably add a List<LineItem> field to your Order entity and it will work as far as the backend is concerned (I haven't tried it, though).

    Another option is to introduce a "displayOrder" integer field to the LineItem entity and keep Order.items a standard Set.

    Comment

    Working...
    X