I do not know how you like, but I like to know what my code is doing.
Memory and very low leve stuff may be ommited but when it comes to ORM its a different story. SQL is NOT low level.
Sometimes I want to control what queries my ORM tool sends to my SQL server.
But there we hit a snag. Its either all or nothing. Hibernate or iBatis are completely different, one you have the freedom of not writting all queries yourself other is having full control over the queries.
Map anything to nothing (iBatis approach)
iBatis offers the luxury of mapping object to essentialy nonexistent entity. Be it a function/procedure call or a complex view(excluding updatable views). But iBatis(SQLMaps to be exact) is like flying an airplane. If you cant ir will stay grounded, if you can it will fly. A lot of queries and no descent generator.
Map something to something(Hibernate approach)
Anything can be autogenerated! Simplicity at it's best. Problem is if you have a table or a view you can map it, otherwise no way. JPA is very similar to Hibernate, excluding annotations(but lets not forget that XDoclet existed for quite a long time).
Problem is that there is a need for only a part of anything2nothing and a lot of something2something. That is why iBatis is not the best choise*.
So what was I searching for I what I did not find:
- simplicity for stuff like "category table with ID and NAME fields"
- control like use this query to get that data
- function/procedure mapping
- ability to specify whitch query should be used for what
But fortunatelly we have JDBC 4.0 on our horisons. iBatis will probably cease to exist due to similarity in its functionality to JDBC 4.0 DataSet. But iBatis and Hibernate still have powerful query construction languages(dynamic query construction in iBatis and HQL in Hibernate) .
So my problem still persists, since we cannot easily mix those 2 methods together.
* - to be exact iBatis can have Hibernate as its base instead of SQL maps, but different managers are required if you need to mix them.
Monday, October 09, 2006
Subscribe to:
Post Comments (Atom)

0 comments:
Post a Comment