Hibernate and iBatis co-existing
AppFuse is in an interesting state right now. In order for me to easily switch to using iBatis for the DAO layer, I left all the Hibernate stuff intact and just added iBatis classes and JARs. The next step is to extract the iBatis stuff into a separate CVS module and write a build.xml file to replace the Hibernate implementation with iBatis.
The one thing that will suck, in the iBatis version, is that the database can't be dynamically created from POJOs. However, if you're going to use the iBatis implementation, its likely that the database (or SQL) already exists. The reason I'm writing this post is because right now, in CVS, you can change the dao.type property to "ibatis" or "hibernate" when building and Voila! - that's the implementation you'll get. I see no reason why any project would ever want to have both implementations (maintenance would be a nightmare), so that's why I'm extracting the iBatis stuff in the next few days.
Posted by Prashant Rane on February 11, 2004 at 01:11 AM MST #
Posted by Jaap on February 11, 2004 at 12:11 PM MST #
Posted by Unknown on February 11, 2004 at 01:25 PM MST #
Last night, I was successfully able to rip out iBatis from AppFuse's core and put it into a contrib directory. I added an "install" and an "uninstall" target (to build.xml in contrib/ibatis) that will install/uninstall iBatis - leaving the Hibernate support intact. Today I'll create another target, "uninstall-hibernate" that will allow the user to choose a iBatis-only solution. That way, if the user runs "install" without running "uninstall-hibernate" they can have both implementations to look at and use.
Posted by Matt Raible on February 11, 2004 at 01:48 PM MST #