RichardMaly wrote:
Our company has been working with Hibernate only several weeks on one big project (accounting system). We will start another project during several weeks (large IS) and our partner wants Toplink.
Is Toplink better as Hibernate (I know that Toplink is not open source and is expensive) ?
Toplink is older which
may result in a more stable and mature OR Layer
whereas Hibernate supports more modern and more open development.
RichardMaly wrote:
Are there some differencies between Toplink and Hibernate ?
Basically OR Mapping can be described by a couple of well implemented desing patterns. Martin Folwer collected them in PEEA. Looking at both tools you can find these patterns.
RichardMaly wrote:
Until now I found these differencies:
1. Toplink has GUI. But it is not very good tool, and time for create java classes, mapping and create DB is the same as write XML for Hibenate. But is it small advantage
The workbench you refer is not so fine IMHO. It does not support all the features the API offers. Hibernate supports XDoclet which is cool as you can tight the mapping close to your code and XDoclet does a lot of work for you by fitering out the informations which are already in classes. In Toplink you have to take care that all the Workbench xml files are in sync with your source control tool (e.g cvs). This process isn't automatable eg. with ant or maven you have a higher automation in you build process. Hibernate is more straight forward in the way to map things wheras Toplink provides a bunch of different mappings (transversion mapping, etc.).
RichardMaly wrote:
2. Toplink has more possibilities to work with database:
* for example I can define my own SQL commands for insert,update,select,delete (it can be important)
This feature sound good at the first moment. In fact Toplink offer more kinds of Queries. But whenever you leave the ObjectLevelQuery land you have to create the POJO's by yourself which is comparable to the way Sun does with Raven (using ResultSet like set of data, iterate it and generate your objects). This may be interesting but needs more work. I'm not sure for the moment but I guess this is possible in Hibernate as well.
Toplink has
no own query language. You have to use a Query API (query-by-example if you like buzz-words). Hibernate already starts to provide something similar but here is Toplink the winner. In many cases a QL is more pragmatic but a API is more configureable and easier to encaspluate.
Toplink has its own nuts and bolts e.g you have to carry yourself about registering the POJO's in the cache (
UnitOfWork.
This is automatically done in Hibernate. You don't have to care about the clones extis in Toplink's world. IMHO the whole eagerness/lazyness is handle better in Hibernate (one-to-one, many-to-one). To get it really workin in every case you have to make your POJO's to so called ValueHolders.
Technical Toplink uses reflection whereas Hibernate tries to use Bytecode weaving whenever possible. Weaving is not even fast it may work more mature whin bitchy class loader envoriments. Oracle OC4J for instance is such an environment.... we needed 3 days to get it working there while the class loading woes causing mystical server hungs.
The support of Toplink via Oracle's Metalink is not that good. You have to deal weaks for weaks with the support to come to a solution. This forum normally has nice response time.
Having said all of this I still guess that Toplink is a good product. It's just does some things in a differnet way as Hibernate. It may work better with Oracle database but as I'm using Hibernate on non Oracle-Database I cannot give you any infos about this concern.
BTW you cannot switch the underlying caching provider of Toplink and you cannot use a different pooling provider (you can use J2EE pooling --> javax.sql.DataSource in Toplink but you must have a enviroment that offers a JNDI Nameservice and a DataSource driven pooling).
Some interesing stuff in this concern: While JBoss 4.x will use Hibernate as future persistence engine Oracle will use Toplink for OC4J/AS.
Hope that helps you to gain some infos.