facebook

Collection not generated in Java Code from Class Diagram…

  1. MyEclipse Archived
  2.  > 
  3. UML Development
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #311421 Reply

    ukcco1mda
    Member

    Hi,
    I am using MyEclipse 8.6-20100723 and UML2.
    I have generated a Shared Association between two classes:

    [RateTransaction] 1<>—– 1..* [RateHeader]

    When I Generate Java from the UML2 menu I was expecting roughly the following:

    RateHeader.java
    import java.util.ArrayList;
    ArrayList<RateTransaction> rateTransactions;

    RateTransaction.java
    RateHeader rateHeader;

    What I actually get is just the import in RateHeader.java and nothing in RateTransaction.java

    #311441 Reply

    ukcco1mda,
    Please find comments below,
    1) You can add a property to the “RateTransaction” class. Select the property and from the Properties view, set the Type of the property to “RateHeader”.
    You can also set the Multiplicity value from the Properties view->Model tab.
    2) UML2->Generate Java should generate the class “RateTransaction” that has a property of type “RateHeader”. The code for multiplicity values set above won’t get generated, but this shouldn’t stop you from using this feature, you can always go ahead and make the changes in the code(changing RateHeader rateheader to List<RateHeader> rateheaders). We are working on this issue and you can expect to get a fix for it in future releases.
    Sorry for the inconvenience.

    #311445 Reply

    ukcco1mda
    Member

    Thanks for looking.

    I have done that myself but I would rather not have to add all those properties to my model.

    I have decided to use UML1 instead – it’s got a rather clunky user interface, but it generates the collections.

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: Collection not generated in Java Code from Class Diagram…

You must be logged in to post in the forum log in