Book a Demo

Author Topic: EA 12 db functions operations dialog: parameters?  (Read 3138 times)

hlampert

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
EA 12 db functions operations dialog: parameters?
« on: April 15, 2015, 11:34:55 pm »
I'm using EA 12 to model the functions in a postgreSQL targeted database.  Using the stereotype <<func>> or <<proc>>, the function definition window pops up when the operation or element is clicked.  This dialog allows for a database specification and the function definition, but there doesn't seem to be a way to record the parameters separately so that they appear on the data modeling diagram.  Is there a way to model database function or stored procedure parameters in EA 12?

hlampert

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: EA 12 db functions operations dialog: paramete
« Reply #1 on: April 18, 2015, 12:06:51 am »
Following up on this, I've decided to model the parameters as class attributes stereotyped as <<parameters>>.  This allows the parameters to display on the diagram, although the code for each function must include a manually maintained parameter list in addition to the attributes.  Not too big a deal, although there is the possibility that the parameters listed as attributes will get out of synch with those listed in the code.

The next problem I'm facing is during code generation when the comments are assigned by the DDL TABLE LEVEL COMMENT template.  This template does not generate working code that assigns the comment correctly, because it has no idea regarding the parameter list required to select the appropriate function.  (PostgreSQL functions can be overloaded, thus the name of the function PLUS the parameter list is required for proper reference).  This is obviously a known problem, because the template unhelpfully states in a comment that "You may need to manually enter parameter(s) for function '$name'".  There's no maybe involved, if thee are parameters to the function you WILL need to edit the generated code to include them for the comment to be properly attached.  Again not a problem really for one function, but I'm managing many, many functions - I can't efficiently edit the template generated code to supply the parameter list for each one each time I generate the functions.

I'd like to alter the DDL templates for creating functions (DDL CREATE FUNCTION) and comment assignment to functions (DDL TABLE LEVEL COMMENTS) so that they read and construct a properly formatted function parameter list from the class attributes, but don't know the proper way to do  this - is there a reference somewhere for reading and manipulating the <<function>> stereotyped classes and working with their attributes?