Author Topic: <table> to class  (Read 453 times)

Thomas Mercer-Hursh

  • EA User
  • **
  • Posts: 386
  • Karma: +0/-0
  • Computing Integrity
    • View Profile
<table> to class
« on: October 26, 2006, 02:58:43 pm »
After poking at EA off and on for a little while, I am now ready to tackle some real work.  In the first project I have imported the schema of an existing database to create a bunch of <table>s under the database in Component Models.  I would now like to select individual <table>s and create an equivalent regular class so that I can supplement the data with behavior and add in the classes which will not be persisted.  It seems like one should be able to do this and to create a link so that one will know that one is the expression of the other, but I'm not finding a procedure or tool that does this.  Am I missing something?  Where else should I look?

Simon M

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 6216
  • Karma: +49/-5
    • View Profile
Re: <table> to class
« Reply #1 on: October 26, 2006, 03:47:50 pm »
Have a look at the transformation support in EA. (http://www.sparxsystems.com/EAUserGuide/index.html?mdastyletransforms.htm)

There currently isn't a built-in transformation to do what you want.  A simple tranformation would copy everything except for the stereotype and language.  To do this create a new transformation and edit the default class template by adding "stereotype" and "language" to the TRANSFORM_CURRENT macro. (http://www.sparxsystems.com/EAUserGuide/index.html?transformingduplicateinforma.htm)

From there you'll also want to ignore all operations, remove stereotypes from attributes and associations and do some type mapping.
Simon

support@sparxsystems.com