What's the difference between those query translators (I mean differences for me as a Hibernate user). Some blogs on the internet say that ANTLR-based translator is faster. But I deem that if one of them was clearly better, then Hibernate developers would remove the other one. So.. what's the difference and why do we have both of them? In what situations should I choose first or second? In what situations I shouldn't choose one of translators?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
It is an internal hibernate configuration; which got implemented when it got upgraded to version 3. You should not be worried about changing it until unless there is any strong reason for it. Also with the latest versions I think you need to change its default value. But if you want you can test it for performance improvement as told below.
From the Hibernate Core Migration Guide : 3.0;
Here is Forum post and a blog post regarding this issue.
Now coming to your questions;
As told in the change log, hibernate 3 replaces the
ClassicQueryTranslatorFactory
withASTQueryTranslatorFactory
. It is an internal change and the users need not be wooried about it until the change breaks your application.By default
ASTQueryTranslatorFactory
is enabled, you should consider changing it only if any of your queries break while upgrading to version 3.Once again, it a story of the past(2006 or so); the latest version of hibernate is 4.1 and the query translator must be stable by now. So 99% you do not have to change any thing.