Matt Parker wrote:

Hi All,

I've got an existing application that I'd really like to retrofit
into Poseidon and Andromda for the next release because there will be
some new heavy EJB development for it. I've got my existing model pretty
much implemented in Poseidon, but I'm having trouble with Andromda on a
few points:-

1) I need BMP (I think), because I have some logic that for example
needs the results of a "select count(*) from ..." and I've yet to work
out how to do that in CMP. Of course, someone might enlighten me :-)


Well, there's nothing saying you can't work a few JDBC connections into your code to do the count(*) stuff, is there?

2) A very important thing in my schema is that the primary key of some
tables cannot be an arbitrary ID like in the generated Andromda code.
For example, I have an admin table where the username is the primary key
because it needs to be unique. Anyone got an idea how to go about this
in Andromda?


You're looking at some Cartridge changes to get that kind of thing done. But they're really minimal. Take a look at my MDA pages at http://www.nsdev.org/mda/stories/mda-templates.html where I've done exactly that. I highly recommend learning how to write your own Cartridges, because I've found that a cartridge is really hard to make 'generic' and usually adapts along with a project. In the end, hopefully you have something that's reusable for other projects.

3) Finally, how do I get Andromda to include extra finders so I can use
comparison EJB-QL like "SELECT OBJECT(o) FROM XxxxEJB o WHERE o.property
<= ?1". In the generated ejb-jar.xml there's a comment about defining
extra finders in an external XML file. Presumably I don't add the
<<FinderMethod>> stereotype in Poseidon in order that Andromda doesn't
try to generate it, but I can't work out where to put my external
finders file. Any pointers?


Again, have fun modifying the Cartridges. Remember that ejb-jar.xml isn't generated from AndroMDA instead it's generated by XDoclet. What you want to do is get the AndroMDA templates to generate more finders for you. I have to update my AndroMDA templates because I've already set up something that will look for a 'query' tagged value and puts that in as the ejb-ql query. Of course, with every AndroMDA cartridge, there should be a sample model showing all of the different ways they can be used. I intended to do something like that on my web page, but I guess I forgot.

I'll rectify both of those problems sometime tomorrow. I hope the advice helps, anyway.

-Neal


------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ Andromda-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/andromda-user

Reply via email to