facebook

UML one to many relation :- how to change Vector to Set

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

    HI, when generating java code from UML class diagram, one-to-many relationship results into Vector. is there any way that we can change this default to our own prefrence like Set. Thanks in advance.

    – System Setup ——————————-
    *** Date: Tue Apr 04 11:19:11 IST 2006

    *** System properties:
    OS=WindowsXP
    OS version=5.1
    Java version=1.4.2_08

    *** MyEclipse details:
    MyEclipse Enterprise Workbench

    Version: 4.1.1 GA
    Build id: 20060309-4.1.1-GA

    *** Eclipse details:
    Eclipse SDK

    Version: 3.1.0
    Build id: I20050627-1435

    Eclipse Platform

    Version: 3.1.0
    Build id: I20050627-1435

    Eclipse RCP

    Version: 3.1.0
    Build id: I20050627-1435

    Eclipse Java Development Tools

    Version: 3.1.0
    Build id: I20050627-1435

    Eclipse Plug-in Development Environment

    Version: 3.1.0
    Build id: I20050627-1435

    Eclipse Project SDK

    Version: 3.1.0
    Build id: I20050627-1435

    Eclipse startup command=-os
    win32
    -ws
    win32
    -arch
    x86
    -launcher
    C:\Program Files New\eclipse\eclipse.exe
    -name
    Eclipse
    -showsplash
    600
    -exitdata
    e78_38
    -vm
    C:\j2sdk1.4.2_08/bin\javaw.exe

    #249803 Reply

    Kapil Kapre
    Member

    You can customize this preference *if* your many-to-one relationship is specified as a classifier attribute array of that type. When the attributes are modelled as relationships the preference does not work.

    #250331 Reply

    Ed Thompson
    Member

    Could you give an example?

    #250335 Reply

    Kapil Kapre
    Member

    Sure, simply add an attribute with a user defined data type (or of type Vector) and set its multiplicity to 0..* or 1..*
    Now when you codegen the attribute type chosen in the Global Preference page or in the Project Level Preference Page is used.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: UML one to many relation :- how to change Vector to Set

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