Hi

I agree with your aproach. This is what was in my mind when i wrote
response, but forgot to write. XDoclet really shines on some of this
stuff onceypu get the hang of it - it will also do a lot of Struts stuff
for yu if you bother to put in the struts tags as well.

Hermod

-----Opprinnelig melding-----
Fra: Joe Hertz [mailto:[EMAIL PROTECTED]
Sendt: 7. april 2004 09:36
Til: [EMAIL PROTECTED]
Emne: SV: ORM Tools (Ibatis, Hibernate, OJB....)


Eh, Middlegen and the Hibernate CodeGenerator are a good places to get
an 
idea of what you are going for, but if my experience is any indication,
I 
wouldn't use them for "the real thing", not without a really good
refactoring 
tool.

For starters, at least against a MySQL database, MiddleGen didn't
capitalize 
the classes it generated the way I would have wanted, it gave me clas
names 
like "Myclassname".

That and there's only so much it can glean from the database schema. So
if 
you "over declared" some field widths, plan on it typing your
decimal(11,2) 
fields as java.math.BigDecimal, etc.

My "beat the learning curve" suggestion would be to do this:

Use the tools in order see something *like* what you are going for. The 
syntax will be right. The classes will probably have the getters and
setters 
right at least (not any initializations).

Once your classes are at least looking more or less like what you would 
expect, and that you kinda understand what tht hbm.xml files *should*
look 
like, go back and comment the classes with XDoclet Hibernate tags and
build 
the .hbm.xml files that way, comparing the old and new xml files to see
if 
you missed anything.

Can't say enough about XDoclet. As anal as Hibernate is about these xml 
files, some stuff does get through. XDoclet isn't nearly as picky, but
very 
little can get past both (example: Hibernate will let your class have an
int 
property and the corresponding .hbm.xml file have an "Integer". XDoclet
won't 
let this happen.

HTH,

Joe

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, April 07, 2004 1:48 AM
> To: [EMAIL PROTECTED]
> Subject: SV: ORM Tools (Ibatis, Hibernate, OJB....)
> 
> 
> Hi
> 
> Use Middlegen-Hibernate to do this for you - It makes life a 
> whole lot easier
> 
> 
> Hermod
> 
> -----Opprinnelig melding-----
> Fra: John McGrath [mailto:[EMAIL PROTECTED]
> Sendt: 6. april 2004 20:47
> Til: 'Struts Users Mailing List'; [EMAIL PROTECTED]
> Emne: RE: ORM Tools (Ibatis, Hibernate, OJB....)
> 
> 
> Likewise, I don't know much about iBatis, but from looking at 
> their docs, it seems closer to traditional JDBC. We use 
> Hibernate and have been very happy with it, but there was bit 
> of a learning curve involved, especially in understanding how 
> to write the xml mapping files that Hibernate uses to create 
> tables and define relationships.
> 
> Also, Hibernate frees you from JDBC, but it has its own query language
> (HQL) that is very much like SQL.
> 
> 
> From: Paul Barry [mailto:[EMAIL PROTECTED] 
> 
> I don't know much about ORM toools, but I can say that iBatis 
> SQL Maps 
> is not an ORM tool.  As I understand it, ORM tools map java object to 
> database tables, whereas SQL Maps map java objects to SQL statements. 
> iBatis just makes using JDBC much easier, whereas ORM tools hide the 
> JDBC from you, doing the persistence work for you.  Hibernate and OJB 
> might be useful depending on your project, but SQL Maps will be an 
> easier transition for you if you are used to working with JDBC, 
> especially in a place where you may have people that 
> specifically work 
> on writing and tuning SQL queries.
> 
> Marcelo Epstein wrote:
> 
> > Hi,
> > Thanks everybody!
> > Now I am convinced to use an ORM tool. The big problem is 
> whitch one?
> > Hibernate? Ibatis ?OJB? Whitch one is preferable to use 
> with Struts??
> > 
> > Macelo Epstein
> > 
> > 
> > 
> > On Tue, 06 Apr 2004 11:29:21 -0600, "Larry Meadors"
> > <[EMAIL PROTECTED]> escreveu:
> > 
> > 
> >>De: "Larry Meadors" <[EMAIL PROTECTED]>
> >>Data: Tue, 06 Apr 2004 11:29:21 -0600
> >>Para: <[EMAIL PROTECTED]>
> >>Assunto: Re: Connection Pooling (How i use...)
> >>
> >>I have yet to see a *good* example of how to do jdbc on the net.
> >>
> >>Most are very simple one-off "throws SQLException" examples 
> that don't
> 
> >>seem to take into consideration little things like stability and
> >>releasing resources. :)
> >>
> >>That is why I think tools like iBATIS are so powerful - you get all
> >>the power of JDBC without the pain.
> >>
> >>Larry
> >>
> >>
> >>>>>[EMAIL PROTECTED] 04/06/04 11:15 AM >>>
> >>
> >>Now I am closing the connection in the finally block.
> >>The exemple...
> >>
> >>------------------------------------------------------------
> ---------
> >>To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >>
> >>
> > 
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
> * * * * * * *
> 
> This email with attachments is solely for the use of the 
> individual or entity to whom it is addressed. Please also be 
> aware that DnB NOR cannot accept any payment orders or other 
> legally binding correspondence with customers as a part of an email. 
> 
> This email message has been virus checked by the virus 
> programs used in the DnB NOR Group.
> 
> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
> * * * * * * *
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to