Book a Demo

Author Topic: Association class, generate code  (Read 3073 times)

jercoli

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Association class, generate code
« on: May 02, 2006, 11:43:06 am »
I make a simple association class (source code:java), and the generate code not include attributes of both classes associated.
Ex:
Person associate with Company
Job (associate class)

In Job must have : Person m_Person and Company m_Company, but the code not include this.

Solution??, Thanks in advance.


Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Association class, generate code
« Reply #1 on: May 03, 2006, 03:22:30 pm »
Sorry, but EA currently doesn't generate code from association classes.

If you generate all three classes you will see attributes generated as if the Job class was completely unconnected.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Association class, generate code
« Reply #2 on: May 03, 2006, 03:37:57 pm »
Simon,

Can we get at the association classes from custom scripts somehow? Or perhaps via automation. I know they can be identified via automation but keep thinking (it was a while back that I did this) that I need to read the back end database records directly.

Surely there is a more elegant way.

TIA,
David
No, you can't have it!

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Association class, generate code
« Reply #3 on: May 03, 2006, 03:55:10 pm »
It is possible to get it from the automation interface, although I don't deal with that often.

From the class side you can look for Type=="Class" and Subtype==17.  If that is true then MiscData[3] (PDATA4)
corresponds to the Connector ID of the association.

From the association side look for Type=="Association" and Subtype=="Class".  If that is true then PDATA1 corresponds to the Object ID of the class, although I can't find this in the automation interface documentation.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Association class, generate code
« Reply #4 on: May 03, 2006, 04:25:10 pm »
Thanks Simon,

That sounds like how I managed from the Class side. I was unaware of the approach from the association side. This will allow me to avoid some strange roundabout queries on the background data channel.
No, you can't have it!

cgaviao

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Association class, generate code
« Reply #5 on: August 12, 2006, 05:39:29 am »
Quote
Sorry, but EA currently doesn't generate code from association classes.

If you generate all three classes you will see attributes generated as if the Job class was completely unconnected.


Hi, I would like to know if on ea v6.5 this will be provided.

thanks

Cristiano