Hi Stuart,

the XDoclet-attributed POJOs you want are already generated by the
Hibernate cartridge. Simply switch off the generation of the session
beans because you won't need them for the POJOs to persist in Hibernate.
In that case, you only have to open and close Hibernate sessions
manually, as well as open and close database transactions via JTA.

To switch off the generation of session beans, delete some lines from
the cartridge descriptor of the Hibernate cartridge and rebuild
AndroMDA. The file name is andromda-cartridge.xml.

If you want to make things perfect, write new templates for the
generation of non-EJB-based session facades that open and close
Hibernate sessions and transactions. I am looking for such a solution
because my webhost has the same restrictions for Java deployment as
yours! :-) So, if you want to give us something back, contribute the new
session facade templates as a patch in the AndroMDA patch area at
http://sourceforge.net/tracker/?group_id=73047&atid=536547 .

Cheers...
Matthias

> -----Original Message-----
> From: Stuart Zakon [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, November 25, 2003 4:58 PM
> To: [EMAIL PROTECTED]
> Subject: Re: andromda and hibernate
> 
> 
> Hi Matthias,
> Thanks for your response.  It helps clarify what I saw in the 
> Velocity templates for Hibernate, that they generate EJB 
> Session Beans.  Problem is that we run in Resin, which has 
> EJB support but not on my hosting company. So we use strictly 
> JSP/Servlet/XSLT/JDBC/MySQL for our application.  
> 
> I was hoping that the Hibernate cartridge would take an XMI 
> file from MagicDraw UML, and create Java classes (POJO's) 
> with XDoclet tags for Hibernate.  I assume that this should 
> be possible as a cartridge. I haven't figured out how to get 
> the mappings correct for the table and column names, but the 
> cartridge could create the default values using the same 
> names as the Java names and then the XDoclet tags could be 
> hand edited.
> 
> Thanks,
> Stuart Zakon
> Objects by Design
> 
> 
> --- [EMAIL PROTECTED] wrote:
> > Hi Stuart,
> > 
> > 
> > 
> > I am not sure if I understand your question. Anyway: AndroMDA's 
> > Hibernate cartridge generates objects for Hibernate 
> persistence, not 
> > for EJB persistence. However, it uses EJB session beans for session 
> > control and for transaction control. If you generate the car rental 
> > sample from the sources, you will see a lot of files appear in the 
> > directory samples/car-rental-system/src/hibernate/generated 
> - this is 
> > what the Hibernate cartridge generates.
> > 
> > 
> > 
> > There is also an EJB cartridge. It uses CMP 2.0 to make objects 
> > persistent but that is an entirely different story.
> > 
> > 
> > 
> > Both cartridges generate their code from the *same* kind of 
> UML model 
> > (maybe this is the reason for your question?). The OMG 
> would say, they 
> > use the same "UML profile", that means, especially the same 
> > stereotypes. The model is contained in 
> CarRentalSystem20.zuml, a file 
> > generated by the Poseidon CASE tool.
> > 
> > 
> > 
> > For more questions, please feel free to subscribe and post to the 
> > andromda-user list.
> > 
> > 
> > 
> > Cheers...
> > 
> > Matthias Bohlen
> > 
> > 
> > 
> >  --- Urspr�ngliche Nachricht ---
> > 
> > Datum: 25.11.2003 04:21
> > 
> > Von: [EMAIL PROTECTED]
> > 
> > An: [EMAIL PROTECTED]
> > 
> > Betreff: andromda and hibernate
> > 
> > 
> > 
> > > I have downloaded the latest andromda and cartridges 
> modules and was
> > looking at
> > 
> > > hibernate support. Is this for EJB persistence? I was 
> thinking that
> > andromda
> > 
> > > could be used to create the xdoclet tags used to create hibernate
> > mappings.  Is
> > 
> > > this not the case?
> > 
> > >
> > 
> > >
> > 
> > >
> > 
> > > =====
> > 
> > > Stuart Zakon
> > 
> > > Objects by Design
> > 
> > > http://www.objectsbydesign.com
> > 
> > >
> > 
> > 
> > 
> > 
> > 
> 
> 




-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
Andromda-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/andromda-user

Reply via email to