Re: Re[2]: [Hibernate] Check named queries

2004-07-01 Thread Oleg Proudnikov
Hi, Aaron wrote: [snip] Those cases where Hibernate generates SQL that is not compatible with a specific database should be treated as bugs in Hibernate. (i.e. The Dialect implementation is incorrect.) What I would like to see is one of two types of exception thrown during HQL compilation: 1)

RE: Re[2]: [Hibernate] Check named queries

2004-06-30 Thread Aaron Knauf
> > I suggest that named query validation be done by the > > Dialect implementation, rather than by checking against a live DB. > > Why the dialect? It doesn't know about the schema, does it? Ok, I guess I wasn't being particularly precise when I suggested the Dialect. The complete validat

Re[4]: [Hibernate] Check named queries

2004-06-30 Thread Max Rydahl Andersen
Hello Joshua, > Just a thought: A mapping->schema check could be something that the user > could > enable or disable in the Hibernate configuration, or as a separate tool. > Come to think of it, doesn't the 'auto ddl' option already do this in some > way? That was what my boring long message wer

RE: Re[2]: [Hibernate] Check named queries

2004-06-30 Thread Joshua Davis
See my comments below. (Please remember that I'm the FNG around here so my comments might be dumb ;->). > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of Aaron Knauf > Sent: Tuesday, June 29, 2004 6:24 PM > Subject: RE

RE: Re[2]: [Hibernate] Check named queries

2004-06-29 Thread Aaron Knauf
u have done so with competence. That was my $0.02 worth. Cheers ADK > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of Max > Rydahl Andersen > Sent: Wednesday, June 30, 2004 6:08 AM > To: Joris Verschoor > Cc: [EMAIL PROTECTED

Re[3]: [Hibernate] Check named queries

2004-06-29 Thread Max Rydahl Andersen
Hello Max, Tuesday, June 29, 2004, 8:07:35 PM, you wrote: > - as correct as possible/necessary > - as fast as possible/necessary > ...but most important as usable and maintainable as possible! That should be "...as usable, *safe* and maintainable as possible!" Best regards, Max Rydahl Anderse

Re[2]: [Hibernate] Check named queries

2004-06-29 Thread Max Rydahl Andersen
Hello guys, What we need is two things: 1. check the , , mapping etc. against the database 2. check if the namedQueries are valid This stuff should be: - as correct as possible/necessary - as fast as possible/necessary ...but most important as usable and maintainable as possible! Using some

Re: [Hibernate] Check named queries

2004-06-29 Thread Joris Verschoor
Emmanuel Bernard wrote: I don't see how HQL query can insert update delete. Even a trigger cannot do that. I meant namedsqlqueries, but in the future, it could be possible to be used for inserting / updating data. I don't know if hibernate is going to go that way.. Remember that I won't load any e

Re: [Hibernate] Check named queries

2004-06-29 Thread Emmanuel Bernard
I don't see how HQL query can insert update delete. Even a trigger cannot do that. Remember that I won't load any entity for real (1=0). We could add the keyword in Dialect, but let's start with the HQL queries first. I'm not sure the syntaxt is always SPEIFIC_KEYWORD on every DB. Joris Versch

Re: [Hibernate] Check named queries

2004-06-29 Thread Joris Verschoor
compiling named queries only checks hql / mapping (sometimes hql is correct, but the query it generates is not supported on the db) NamedQueries can not only be heavy, but can also destroy / insert / update data. Maybe there we could add some sort of getCheckSyntaxString(String queryString) to D

Re: [Hibernate] Check named queries

2004-06-29 Thread Emmanuel Bernard
"from A as a where 1=0" should check the DB fields easily wo any data size drawbacks. For SQL Query this is a bit more complex because queries may be heavy, so we can't execute them for real. I'm not sure EXPLAIN is really portable. So to sumarize: - Compile all mapping documents to metamodel, c

Re: [Hibernate] Check named queries

2004-06-29 Thread Joris Verschoor
Hi, I've created that patch. The code in the ant task was all I could think of... A check for database fields would be quite nice actually, when working on several machines, I sometimes forget to modify a table. That could be done by doing a find on every perstisted class (load will throw an error

Fwd: [Hibernate] Check named queries

2004-06-28 Thread Christian Bauer
On Jun 28, 2004, at 6:45 PM, Emmanuel Bernard wrote: Actually the ant task wrapping is done and just call for a session factory build. Do you think it's enough? I think the validator should do the following: - Compile all mapping documents to metamodel, check for persistent classes - Compile all

Re: [Hibernate] Check named queries

2004-06-28 Thread Emmanuel Bernard
Actually the ant task wrapping is done and just call for a session factory build. Do you think it's enough? Christian Bauer wrote: On Jun 28, 2004, at 6:27 PM, Emmanuel Bernard wrote: I would be ready to apply the YAGNI principle and not provide such param (yet). What do you guys think? I think

Re: [Hibernate] Check named queries

2004-06-28 Thread Christian Bauer
On Jun 28, 2004, at 6:27 PM, Emmanuel Bernard wrote: I would be ready to apply the YAGNI principle and not provide such param (yet). What do you guys think? I think it should be configurable. I've heard one or two requests for a "mapping validation tool" that you could run independently from Hib

[Hibernate] Check named queries

2004-06-28 Thread Emmanuel Bernard
I'll commit a patch allowing checking of named queries at SessionFactory build. I'm wondering whether this feature should be disabled by configuration or not. Imagine you're working on an Hibernate Query and you don't call for it in your code yet. The checking will fail unless you comment it on