Help

We just released Hibernate 3.0 beta 1. I've no time to list all the many changes since the alpha was released four months ago, let alone everything that is new in Hibernate3, which has been in development for over a year now.

The most exciting new thing from our point of view is the new AST-based HQL parser, written by Joshua Davis. It uses 3 ANTLR grammars to transform HQL/EJBQL to SQL. The work on this is not quite finished, but almost all legacy tests pass. You can try out the new query parser by setting

hibernate.query.factory_class=org.hibernate.hql.ast.ASTQueryTranslatorFactor

I'll try to get Joshua to blog about the design of the parser (very cool stuff).

7 comments:
 
21. Dec 2004, 02:22 CET | Link
analogueboy
It'd be great if the classes used in hibernate like this query manager and the cache provider could be inserted thru IoC like spring rather than having to provide 0-arg constructors. Just a thought ;)
 
21. Dec 2004, 03:30 CET | Link
Gavin
hum, its a thought .... we could use pico for this (spring is a bit too heavyweight for embedding in hb).

I bet this is the kind of thing steve would love ;)
 
21. Dec 2004, 16:30 CET | Link
Juergen Hoeller
It would already be a great enabler if you could pass ConnectionProvider, CacheProvider etc *instances* to Hibernate's Configuration object, rather than just class names. All we would need in Hibernate is corresponding methods on Configuration; no embedding of an IoC container is necessary for this.

This would allow Spring's LocalSessionFactoryBean to pass existing Spring-managed ConnectionProvider, CacheProvider etc instances to the corresponding Hibernate Configuration methods. Of course, any other IoC container could use a similar strategy.

For the Hibernate 2.1 support in Spring, we currently use what we call "config-time ThreadLocals" to inject dependencies into Hibernate ConnectionProviders and UserTypes. This works, but it is essentially just a workaround for getting Spring-managed references into instances that Hibernate creates.
 
21. Dec 2004, 23:28 CET | Link
analogueboy
Juergen,

Thats actually what I meant rather than bundling an IoC framework, I only mentioned Spring because thats the implementation I'm using.

Gavin - I had a look thru the code to see it would be as simple as extending hibernate's config object to do this, but it wasn't that straight foward. Is this something that you could envisage including in the distribution?

Might me worth taking this on to the hibernate forum?
 
22. Dec 2004, 00:09 CET | Link
max
yup please do.

patches are welcome as always too ;)
 
22. Dec 2004, 19:27 CET | Link
analogueboy
I've started a thread in the forums here http://forum.hibernate.org/viewtopic.php?p=2225474#2225474
and suggested a possible solution. I'm going to test with spring later today and I could provide a patch if everything works correctly.
 
27. Dec 2004, 23:24 CET | Link
Joshua Davis | pgmjsd(AT)yahoo.com
Oh, I guess I should blog this up. If only I had an account on this Hibernate blog thing. ;)