Subtle code generation problem with association classes

Hi,

I encountered a small problem with code generation for an association class:

I have a relationship between LibelleMultiLingue and Langue, naviguable from LibelleMultiLingue to Langue, with an association class. In LibelleMultiLingue, VP generates the following method:

	public Traduction getTraductionByLangue(Langue aLangue) {
		Traduction[] lTraductions = traductions.toArray();
		for(int i = 0; i < lTraductions.length; i++) {
			if(lTraductions[i].getLangue().equals(aLangue)) {
				return lTraductions[i];
			}
		}
		return null;
	}

This cannot work as is, since equals is not redefined in class Langue. This is of course trivial to solve like this:

    public boolean equals (Object o) {
        if (o == this)
            return true;
        if (o instanceof Langue)
            return (Langue)o.getBusinessKey () == this.getBusinessKey ();
        } else
            return false;
    }

but I think it should be automatically generated, wouldn’t it ? Of course, the user should be able to choose the business key.

For the same diagram, I’d like to be able to specify that the relationship is mapped to a Map, indexed by one of the existing fields of the target class of the association (“businessKey” in class “Langue” in my sample). Is this possible ? I didn’t find any way to do that. Choosing “Map” for the association in “ORM/Collection type” produces a Map indexed by an auto-generated field in the target class.

Anyway, SDE is a great, great product !

Thanks in advance for any remark,

JM


Hi Jean-Marie,

Sorry for my late reply. Actually I have passed your message on to our team before, but I forgot to post here. Anyway, I will keep you posted on any updated news about your request.

Best Regards,
Jick

Hi Jean-Marie,

I just sent you a private message. Please let me know if you have received it.

Best Regards,
Jick

Hi Jick,

[quote=Jick]Hi Jean-Marie,

I just sent you a private message. Please let me know if you have received it.
[/quote]

I’m sorry, I have been on vacation and didn’t look at the forum: No I didn’t get your private message in my mailbox. Could you please try to repost it ? Thanks a lot for your help, and I am still 200% happy with Visual Paradigm.

Best regards,

Jean-marie

Hi Jean-marie,

I just resent you my private message. Please check your mail box. Thank you.

Best regards,
Jick