struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David G. Friedman" <>
Subject RE: [Hibernate] Who owns the problem?
Date Mon, 03 Oct 2005 16:17:16 GMT

I'm with Martin.  I'd be more likely to skip your call to createQuery():

order by seq").list();

And instead use something like this:

session.find("from SectionForm s order by s.seq").list();

Why?  You shouldn't need the full name and createQuerys are best used if you
have to do things like set parameters, choose min or max results, and so
forth.  Since I'm not seeing that in your query, I recommend using find().
Plus, you shouldn't need the full class name unless you have two object
classes named SectionForm but in different packages.  On top of that, I
recommend putting your query in an XML file as a "Named Query" so you can
update it without having to recompile your java code, should the need ever
arise. Also, you should probably re-read the Hibernate 2.0 (still relevant
in 2.1 and 3.0) tutorial chapter on manipulating data which covers gets,
saves, updates, and the various query types at the url:


-----Original Message-----
From: Martin Gainty []
Sent: Monday, October 03, 2005 9:42 AM
Cc: Struts Users Mailing List
Subject: Re: [Hibernate] Who owns the problem?

Good Morning Murray-

At first glance
The query parameter in the session.createQuery method does not seem to be
formulated properly and appears not to be SQL92 compliant
based upon the example provided here

Anyone else ?

----- Original Message -----
From: "Murray Collingwood" <>
To: <>
Sent: Sunday, October 02, 2005 11:30 PM
Subject: [Hibernate] Who owns the problem?

> Hi guys
> I'm getting exceptions with some Hibernate code and when I post on the
> Hibernate
> forum they are claiming it is a Struts issue.  I've read lots of stuff
> from almost
> everywhere and continue to struggle with this implementation.
> Please check out the background (and config/code) at:
> Please let me know if this is a Struts problem or a Hibernate problem.
> Maybe there's a
> simple solution I'm missing?
> Kind regards
> mc
> FOCUS Computing
> Mob: 0415 24 26 24
> --
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.344 / Virus Database: 267.11.9/116 - Release Date: 30/09/2005
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message