CDO-Hibernate-Teneo [message #615388] |
Mon, 04 February 2008 10:13 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi Eike,
I have started to integration with the teneo mapping generator. For this I have created an interface
HibernateMappingGenerator and an implementation (TeneoHibernateMappingProvider) in a separate plugin.
I have changed the structure of the hibernate store, mainly that the handling of cdopackages is done
using a separate sessionfactory.
The initialzation is now a two-step procedure: 1) initialize the package sessionfactory/store, 2)
read the cdopackages from the database and generate the mapping.
I moved the code for handling (reading/writing) cdopackages to a separate class. This made the
hibernatestore code and initialization a bit cleaner.
I started to work on the unsupportedexceptions. My first one is related to the method:
HibernateStoreWriter.primeNewObject. This method gets a class and returns a new cdoid object. Is
this method for new objects which need to be persisted?
I also noticed that the first object which is persisted is a resource object. You mentioned before
that resources are persisted. What is the (database) model for a resource? In your opinion, should
this be added to a static cdo hibernate mapping (meta.hbm.xml)?
Hibernate works best if each type (eclass) also has a version feature for handling optimistic
locking. It also uses the version property to detect if an object is new or not. In your testmodel
there is no version feature and not all types have a feature which can be used for the id. Do you
agree that I create a separate testmodel which contains this info together with some teneo
annotations? It can be a copy of model1.
Btw, I think you detect that an object is new by looking at the cdoid, correct? Maybe we can use
that in hibernate to detect 'new-ness' instead of the version feature.
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Powered by
FUDForum. Page generated in 0.04559 seconds