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 <select> on every DB.
Joris Verschoor wrote:
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 Dialect
This would allow checking on databases that support things like explain (or maybe some other query that can be used to check a syntax)
If that's done, you can also check the sql syntax of the hql namedqueries
Emmanuel Bernard wrote:
"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, check for persistent classes => building the sessionFactory should do the job.
- Compile all named queries => OK except for SQL ones
- Validate the database schema by querying each table or something => Shouldn't be too hard with the "from A as a where 1=0"
Joris Verschoor wrote:
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 when it's not foud), and checking the exceptions
Another thing that's missing is checking the named sql queries (getNamedSQLQueries) Because of all dialects, the queries have to be executed. Maybe an EXPLAIN <SQL> would do, or a TX <SQL> rollback But it doesn't feel right..
Emmanuel Bernard wrote:
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 it should be configurable. I've heard one or two requests for a "mapping validation tool" that you could run independently from Hibernate. It might be possible that we isolate such functionality, or at least, wrap it in an Ant task or something.
-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel
-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel
-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel
-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel