Book a Demo

Author Topic: Data model code generation  (Read 2998 times)

colin

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Data model code generation
« on: August 10, 2006, 08:05:50 am »
Hi all,

I've got a somewhat vague question.

Whilst using the data modelling and subsequent DDL generation tools recently I was easily able to generate both schema and foreign key constraints. However I seem to have switched something off yesterday because now I seem unable to generate the foreign key stuff.

I have tried anything that resembles a checkbox for setting this on and off but to no avail :-(

They (the FK's) are visible in the model and I can configure the connector but generation is not working.

Any tips very much appreciated

Colin

thomaskilian

  • Guest
Re: Data model code generation
« Reply #1 on: August 10, 2006, 02:27:01 pm »
Can you probably give a little bit of a step-by-step description? Hard to tell what and where something might be wrong...

colin

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Data model code generation
« Reply #2 on: August 16, 2006, 02:02:03 am »
Hi Thomas,

I knew this was vague :-)

There's not that much more to tell really. I go to data model, draw some tables; add associations, defining fk relationships and multiplicity etc. I then try to generate the sql code on the data model by following code generation->generate ddl. However as I mentioned earlier the relationships (alter table sql code) are not being generated.

I have seen it previously but may have switched it off somewhere?

colin

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Data model code generation
« Reply #3 on: August 16, 2006, 05:00:34 am »
I've just been looking into this again, reinstalling EA etc. Unfortunately I'm beginning to draw the conclusion that this functionality is unstable...I hope I'm wrong.

I'm using build 792 and want to generate sql for mysql, am also trying it out for Oracle. I've also been following the help text to define  the foreign key relationship.

After reinstall I initially got correct sql; FK's were being dropped before the tables and then being reset at the end of script. However go in and change something on a table then all info concerning FK's is lost (for ever).

I'm trying to generate the sql for a specific package in one file but individual files don't work either.

Do others make use of this functionality?

Colin

thomaskilian

  • Guest
Re: Data model code generation
« Reply #4 on: August 16, 2006, 01:19:28 pm »
I did not have any problems generating MySQL-DDL so far. You were talking of relations between tables. Are you sure you used the right way to create the FK? It's described in the help and works correctly. But if you're tricking around here you may get in trouble. Maybe, again, you write the steps and I'll try to repro it here.

Owl Saver

  • EA User
  • **
  • Posts: 37
  • Karma: +0/-0
  • Never give up.
    • View Profile
Re: Data model code generation
« Reply #5 on: August 16, 2006, 01:58:01 pm »
Did you see this note in the help at the bottom of the Foreign Keys:

Hint: If you are defining a MySQL database and wish to use foreign keys, you will have to set the table type to allow this.

Oracle will work without changes, but MySQL needs this setting to generate foreign keys.

I hope this helps.