Quote:
1) an object can't span multiple tables (although support for this is forthcoming from what I heard)
I already implemented this and it is working very nicely in v22branch. Anyway, it is not really such a bad shortcoming ;)
Quote:
2) there are some restrictions on FKCs when you're using composite keys, also not null semantics
Ummm, no, not really ... all Hibernate functionality is available for composite keys. In some circumstances you might need to implement Interceptor.isUnsaved().
What are you talking about specifically?
Quote:
3) they have existing SQL queries for their business objects, they want to use them and not have to learn HQL (or even use the SQL-like sql expression where you can pass where clauses through)
Use a named native SQL query.
Code:
<sql-query name="legacyQuery">
<return alias ="foo" class="Foo"/>
TYPE YOUR SQL HERE
</sql-query>
Quote:
Could you give me some reasons why iBATIS is not as good.
Well, I don't like to bash on iBATIS, since it is a very useful project and is (a) much simpler than Hibernate and (b) better if you are using stored procedures for everything.
However, iBATIS doesn't implement features like:
* automatic dirty checking
* proper association support (including efficient fetching strategies, transitive persistence, etc)
* caching
* object-oriented queries (with polymorphism, etc)
* dynamic-insert / dynamic-update
* transactional write-behind
* (Does it support JDBC batch updates yet?)
* etc...
So for an application with a complex domain model, and a reasonably sane relational schema, Hibernate will save LOC and most likely perform better. (Also, the application can be very portable between database vedors, if that matters to you.)
But the final choice really depends upon what you are doing. For simple applications, or applications with a really screwy legacy database, or SPs everywhere, iBATIS is a good choice and has an easier learning curve.