Marco,

You are incorrect in saying Hibernate needs one hbm.xml file per class.  You
can put all of your class definitions and named queries in one
SOMETHING.hbml.xml file.  This is in the documentation, see the cats and
dogs example, section 5.1.2.  I do it myself.  You would just need one XML
file for the connection information and one XML file to contain your class
definitions and named (or parameterized) queries which is used at
configuration initialization.  I did it that way until I started using the
XDoclet Eclipse plug-in (JBossIDE actually).

Regards,
David

-----Original Message-----
From: Marco Mistroni [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 28, 2004 4:29 AM
To: 'Struts Users Mailing List'; 'Peng Tuck Kwok'
Subject: RE: [OT] SQL in XML file


Hello,
>I don't think hibernate does sql in a xml file.... .
>I think it's more of a mapping of objects.

Not in own xml file... but if you have the  YourHIbClass.hbm.xml, you
can put your sql 'queries'  in there..
Of course, that's only for a specific class.... every class that you use
Will need to have its own hbm.xml file, so your sqls will be 'scattered'
Throughout all classes..

2 cents again :-)

Regards
        marco



>Ashish, you are probably looking for a ORM right ?  You could look at
>hibernate,
>Cayenne  and there's one from apache as well.


On Thu, 28 Oct 2004 08:41:15 +0100, Marco Mistroni
<[EMAIL PROTECTED]> wrote:
> Hello
>         Hibernate does something like that, you may want to
> Have a look at it..
> Alternatively, I have done a similar thing for my own webapp,
> Where I have  a 'persistence layer' that reads an xml config
> File where I list all sql statements and mapping between
> Columns and DTO fields (I user reflections for populating DTOs..)
> I am using digester to build a Map out of the XML..
> Not so difficult, however if there is a tool that does it
> For you (Hibernate for example), it will save you time :-)
>
> My 2 cents...
>
> Regards
>         marco
>
> -----Original Message-----
> From: Ashish Kulkarni [mailto:[EMAIL PROTECTED]
> Sent: 27 October 2004 18:02
> To: [EMAIL PROTECTED]
> Subject: [OT] SQL in XML file
>
> Hi
> Is there any code out there or any one worked on a
> framework, where we can define SQL statements in XML
> file and at runtime java program will read this XML
> file, build the SQL if prepared statement and execute
> it and return a ResultSet
>
> What may be the points to be taken into consideration
> if i have to write a new one
> Ashish
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail Address AutoComplete - You start. We finish.
> http://promotions.yahoo.com/new_mail
>
> ---------------------------------------------------------------------
> 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]


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

Reply via email to