Book a Demo

Author Topic: Newbie wants to model entity beans  (Read 3277 times)

onewnan

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Newbie wants to model entity beans
« on: May 26, 2004, 08:50:23 am »
I have an application with a very messy database schema and need to reimplement it using entity EJBs.  

I put together an E-R style class diagram showing entities and association links with cardinalities.  From this I can generate UML and POJOs, but it doesn't appear I can generate DDL from generic UML classes--I need to use table objects for this.  I

would prefer to model objects from the perspective of behavior (operations) as well as attibutes, but I don't want to be fighting with my tool!  What's a good way to model and maintain entity beans using EA?

thomaskilian

  • Guest
Re: Newbie wants to model entity beans
« Reply #1 on: May 26, 2004, 02:30:34 pm »
Hi,
as far as I know you only can generate DDL from <<table>> stereotyped classes (I may be wrong with that, though).

onewnan

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Newbie wants to model entity beans
« Reply #2 on: June 01, 2004, 07:50:28 am »
Thank you, that may be obvious but again I'm a newbie!  If there's an obvious resource I should be accessing please just point me in th right direction.

In fact I don't even know how to get a hold of EA support.  If that requires licensing, perhaps I can expedite processing through Purchasing.

Anyhow, what I'm finding is that once I use the <<table>> stereotype I can generate DDL but no longer Java.  This is true even if I turn the stereotype off, there must be some marker remaining in the metadata.

This is really a problem since I need to manage entity bean, database and XML-Schema off a common model.     I need to do some extensive refactoring of the current database design, splitting and merging many tables.  

Not only can't I configure the model to generate both DDL and JavaBeans, but I don't even see a straightforward way to maintain two versions of the model.  For example Rational Rose has automated facility to create a deployment model and traces from an analysis model, but I don't see how to do that from EA.   I don't even see a way to copy a collection of objects from one package to another, but again I'm a newbie.

Can anyone tell me how I can unmark my objects so I can generate Java again?  Perhaps I can create my database, reverse engineer the tables, then change the tables to plain old Java objects.

While we're at it, the package statements in the generated Java reflect the entire package stucture e.g., "Data Model.com.psi.e_and_e.domain" even when I select com as the root directory.  Is there any way to generate Java properly from a subfolder?

Returning to the common model issue:

Perhaps I should generate my own schema etc off the back end by postprocessing the XMI.  Are there an API and examples for programming against the metadata?  

Or perhaps I should insert XDOCLET metadata in the comments and use that to generate beans.  Has anyone tried this?

Surely we're not the first ones to try modelling entity EJB with EA!

thomaskilian

  • Guest
Re: Newbie wants to model entity beans
« Reply #3 on: June 04, 2004, 12:13:57 am »
onewnan,
shurely you will receivce personal support only after purchasing a license  ;D

I do not model EJB (nor do I code anything except for personal fun) when I work with EA. I just know that there are a lot of Java-related topics. EJB is not discussed too much here. What I can say: EA is pretty unspecialized so you can use it for quite many purposes. Talking of database modeling it is only possible to create DDLs for <<table>> stereotyped classes. Having tables it does not make much sense to create code for these. Probably you can create a schema for Beans that create Java code as well as DDLs. Honestly speaking I can not give much help here (see above). In your EA installation path you will find a set of xml files that describe the way code is generated. You might adopt these for your purpose (or maybe someone did this already ???).

HTH a little