Mod4j: Modeling for Java using Domain Specific Languages

Ordered association lacks method to use the ordening.

Details

  • Type: Improvement Improvement
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.0.0
  • Labels:
    None
  • Number of attachments :
    0

Description

For ordered associations the following method are generated:

  • addTo***(element)
  • removeFrom***(element)

To be able to use the ordering in a meaningful way the following method need to be generate as well:

  • addTo***(index, element)
  • removeFrom***(index)
  • set(index, element)

These match the methods in the Java List interface.

Issue Links

Activity

Hide
Eric Jan Malotaux added a comment -

Without an 'equals()' method that can compare objects by the persistent 'id' property, you can only remove an element from an ordered collection if it is the same object.
With an 'equals()' method that compares by 'id', if the objects are not the same, you can also remove elements if there were retrieved in a different Hibernate transaction (and session).

Show
Eric Jan Malotaux added a comment - Without an 'equals()' method that can compare objects by the persistent 'id' property, you can only remove an element from an ordered collection if it is the same object. With an 'equals()' method that compares by 'id', if the objects are not the same, you can also remove elements if there were retrieved in a different Hibernate transaction (and session).
Hide
Eric Jan Malotaux added a comment -

Done.

Show
Eric Jan Malotaux added a comment - Done.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: