Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Manually creating persistence.xml or hbm.xml
Manually creating persistence.xml or hbm.xml [message #514611] Mon, 15 February 2010 23:33 Go to next message
Lemao  is currently offline Lemao Friend
Messages: 48
Registered: December 2009
Member
I have a somewhat large EMF model where I want to persist a subset of them using Teneo. Some of these persitent classes are somewhat independent and so easily made persistent with Teneo. However, I have a bunch of other EClasses that need to be partially persisted to the database if at all.

1) The first problem I am facing is that base EClass are considered top level entities even though their own purpose is for a proper in-memory abstraction. I am assuming that @MappedSubclass will solve this although I wasnt able to verify due to the next issue.

2) The next problem is that Teneo is, as expected, traversing all references in my model to things I dont want to persist. In some cases I dont want to persist a whole EClass and in some cases I dont want to persist a few references. Looking at the code I noticed that the top-level entity resolution takes into account the transient EMF property, but since my models are also written to files, I dont have the luxury of turning my EClasses or the specific references transient. I then came across adding @Transient annotation to EClass. After I added @Transient to all the EClasses I didnt want persisted to the db I still seems to traverse all references even though the EClasses have the @Transient annotation.

3) I then thought that a good way to do this would be to take the mappings entirely into my hands. I grabbed a dump of the mappings generated by Teneo (I had a fairly independent part of the model persisted in Teneo), set the required PersistenceOptions to read from a file instead of auto generating and then manually added the mappings for the EClasses I wanted to persist and only the attributes/references I needed. Here I got exception in the EMFTuplizer. Is this possible, i.e. craft the mapping in Hibernate HBM or JPA persistence.xml entirely by hand?

At this point I am not sure what to do and wondering if I am missing something obvious here?

Thanks in advance,

In addition, would it be possible to write my mappings directly in Hibernate hbm or JPA persistence.xml without using the mapping generation?
Re: Manually creating persistence.xml or hbm.xml [message #514640 is a reply to message #514611] Tue, 16 February 2010 08:08 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Lemao,
See comments inline.

btw, Teneo is supported on the main EMF newsgroup which I added in the cc.

gr. Martin

Lemao wrote:
> I have a somewhat large EMF model where I want to persist a subset of
> them using Teneo. Some of these persitent classes are somewhat
> independent and so easily made persistent with Teneo. However, I have a
> bunch of other EClasses that need to be partially persisted to the
> database if at all.
>
> 1) The first problem I am facing is that base EClass are considered top
> level entities even though their own purpose is for a proper in-memory
> abstraction. I am assuming that @MappedSubclass will solve this although
> I wasnt able to verify due to the next issue.
MT>> Yes @MappedSuperclass should solve this.
>
> 2) The next problem is that Teneo is, as expected, traversing all
> references in my model to things I dont want to persist. In some cases I
> dont want to persist a whole EClass and in some cases I dont want to
> persist a few references. Looking at the code I noticed that the
> top-level entity resolution takes into account the transient EMF
> property, but since my models are also written to files, I dont have the
> luxury of turning my EClasses or the specific references transient. I
> then came across adding @Transient annotation to EClass. After I added
> @Transient to all the EClasses I didnt want persisted to the db I still
> seems to traverse all references even though the EClasses have the
> @Transient annotation.
MT>> This should work as you expected. Did you regenerate the java source code after setting the annotation on the EClass?
You can also add the @Transient annotation in the EStructuralFeature to prevent persisting that specific feature.

>
> 3) I then thought that a good way to do this would be to take the
> mappings entirely into my hands. I grabbed a dump of the mappings
> generated by Teneo (I had a fairly independent part of the model
> persisted in Teneo), set the required PersistenceOptions to read from a
> file instead of auto generating and then manually added the mappings for
> the EClasses I wanted to persist and only the attributes/references I
> needed. Here I got exception in the EMFTuplizer. Is this possible, i.e.
> craft the mapping in Hibernate HBM or JPA persistence.xml entirely by hand?
> At this point I am not sure what to do and wondering if I am missing
> something obvious here?
MT>> Hmm, you got a dump of the mappings created by Teneo and then added your own eclasses, were those eclasses not
already present in the mapping?
What exception did you get?

>
> Thanks in advance,
>
> In addition, would it be possible to write my mappings directly in
> Hibernate hbm or JPA persistence.xml without using the mapping generation?
MT>> It can be done, but the easiest strategy is to let Teneo generate an initial mapping, store that in a hbm file and
then adapt this mapping manually if needed.
At runtime you need to use the Teneo runtime layer because Teneo adds logic to Hibernate to handle EMF specifics
(bi-directional lists, containment etc.)

>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
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
Re: Manually creating persistence.xml or hbm.xml [message #514757 is a reply to message #514640] Tue, 16 February 2010 14:55 Go to previous messageGo to next message
Lemao  is currently offline Lemao Friend
Messages: 48
Registered: December 2009
Member
Hi Martin,

Thanks for the comments!

> 2) The next problem is that Teneo is, as expected, traversing all
> references in my model to things I dont want to persist. In some cases I
> dont want to persist a whole EClass and in some cases I dont want to
> persist a few references. Looking at the code I noticed that the
> top-level entity resolution takes into account the transient EMF
> property, but since my models are also written to files, I dont have the
> luxury of turning my EClasses or the specific references transient. I
> then came across adding @Transient annotation to EClass. After I added
> @Transient to all the EClasses I didnt want persisted to the db I still
> seems to traverse all references even though the EClasses have the
> @Transient annotation.
MT>> This should work as you expected. Did you regenerate the java source code after setting the annotation on the EClass?
You can also add the @Transient annotation in the EStructuralFeature to prevent persisting that specific feature.

L>> It seems that there is a first pass that traverses all the EMF references reaching things like EMF XSD Schema, which is not annotated. I was expecting that @Transient on the opposite EClass or on the EReference would preclude Teneo from traversing the dependencies at all, but it seems that the traversal still happens and barfs if it reaches an EClass that is not annotated such as the EMFXSD Schema EClass. My problem is that I am forced to have persistence only on a parallel model without any references to things like EMF XSD.

> 3) I then thought that a good way to do this would be to take the
> mappings entirely into my hands. I grabbed a dump of the mappings
> generated by Teneo (I had a fairly independent part of the model
> persisted in Teneo), set the required PersistenceOptions to read from a
> file instead of auto generating and then manually added the mappings for
> the EClasses I wanted to persist and only the attributes/references I
> needed. Here I got exception in the EMFTuplizer. Is this possible, i.e.
> craft the mapping in Hibernate HBM or JPA persistence.xml entirely by hand?
> At this point I am not sure what to do and wondering if I am missing
> something obvious here?
MT>> Hmm, you got a dump of the mappings created by Teneo and then added your own eclasses, were those eclasses not
already present in the mapping? What exception did you get?

L>> Because of issue 2) I didnt add the extra EPackages for these to the HbDataStore and was hoping I could manually add the hbm mapping for the EClass. But after looking at the code, I noticed that it assumes that all persistent EClasses in the HBM to be processed are present in PAnnotatedModel. The exception was a NPE or something like that in EMFTuplizer after getting a null HbDataStore for the PersistentClass.

> In addition, would it be possible to write my mappings directly in
> Hibernate hbm or JPA persistence.xml without using the mapping generation?
MT>> It can be done, but the easiest strategy is to let Teneo generate an initial mapping, store that in a hbm file and
then adapt this mapping manually if needed.
At runtime you need to use the Teneo runtime layer because Teneo adds logic to Hibernate to handle EMF specifics
(bi-directional lists, containment etc.)

L>> I also read in the documentation that there is way to specify the persistence mapping using an external xml file. I do like this approach since it decouples the model from the mapping completely in spite of the added initial effort to craft the mapping (maybe alleviated by letting Teneo initially generate the mapping). However, this custom mapping xml adds another layer to understand and sometimes we are constrained by it if it doesnt expose all the features found in HBM for instance. I would be quite happier to write the mapping directly in HBM with the proper tuplizer elements, and what not, sprinkled in the xml. At least I am dealing with a mapping I understand and is extensively documented on the web.
After taking a peek at the code, it seems that it is not possible to plug the Teneo runtime (tuplizer, collection adapters, etc) directly into hibernate hbm xml since the code assumes a PAnnotatedModel created, which implies traversing and processing EPackage and the issue found in 2). It would be great if these two layers (annotation and mapping generation, vs teneo runtime) were more independent so I could use just the runtime if I wanted. If this is not the case, would you have a simple example of how to create a plain HBM leveraging just the Teneo runtime?

Of course, a solution for 2) would also help here.

thanks,
Re: Manually creating persistence.xml or hbm.xml [message #514841 is a reply to message #514757] Tue, 16 February 2010 15:18 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Lemao,
I will answer your post on the emf main newsgroup.

gr. Martin

Lemao wrote:
> Hi Martin,
> Thanks for the comments!
>
>> 2) The next problem is that Teneo is, as expected, traversing all
>> references in my model to things I dont want to persist. In some cases
>> I dont want to persist a whole EClass and in some cases I dont want to
>> persist a few references. Looking at the code I noticed that the
>> top-level entity resolution takes into account the transient EMF
>> property, but since my models are also written to files, I dont have
>> the luxury of turning my EClasses or the specific references
>> transient. I then came across adding @Transient annotation to EClass.
>> After I added @Transient to all the EClasses I didnt want persisted to
>> the db I still seems to traverse all references even though the
>> EClasses have the @Transient annotation.
> MT>> This should work as you expected. Did you regenerate the java
> source code after setting the annotation on the EClass?
> You can also add the @Transient annotation in the EStructuralFeature to
> prevent persisting that specific feature.
>
> L>> It seems that there is a first pass that traverses all the EMF
> references reaching things like EMF XSD Schema, which is not annotated.
> I was expecting that @Transient on the opposite EClass or on the
> EReference would preclude Teneo from traversing the dependencies at all,
> but it seems that the traversal still happens and barfs if it reaches an
> EClass that is not annotated such as the EMFXSD Schema EClass. My
> problem is that I am forced to have persistence only on a parallel model
> without any references to things like EMF XSD.
>
>> 3) I then thought that a good way to do this would be to take the
>> mappings entirely into my hands. I grabbed a dump of the mappings
>> generated by Teneo (I had a fairly independent part of the model
>> persisted in Teneo), set the required PersistenceOptions to read from
>> a file instead of auto generating and then manually added the mappings
>> for the EClasses I wanted to persist and only the
>> attributes/references I needed. Here I got exception in the
>> EMFTuplizer. Is this possible, i.e. craft the mapping in Hibernate HBM
>> or JPA persistence.xml entirely by hand?
>> At this point I am not sure what to do and wondering if I am missing
>> something obvious here?
> MT>> Hmm, you got a dump of the mappings created by Teneo and then added
> your own eclasses, were those eclasses not already present in the
> mapping? What exception did you get?
>
> L>> Because of issue 2) I didnt add the extra EPackages for these to the
> HbDataStore and was hoping I could manually add the hbm mapping for the
> EClass. But after looking at the code, I noticed that it assumes that
> all persistent EClasses in the HBM to be processed are present in
> PAnnotatedModel. The exception was a NPE or something like that in
> EMFTuplizer after getting a null HbDataStore for the PersistentClass.
>
>> In addition, would it be possible to write my mappings directly in
>> Hibernate hbm or JPA persistence.xml without using the mapping
>> generation?
> MT>> It can be done, but the easiest strategy is to let Teneo generate
> an initial mapping, store that in a hbm file and then adapt this mapping
> manually if needed.
> At runtime you need to use the Teneo runtime layer because Teneo adds
> logic to Hibernate to handle EMF specifics (bi-directional lists,
> containment etc.)
>
> L>> I also read in the documentation that there is way to specify the
> persistence mapping using an external xml file. I do like this approach
> since it decouples the model from the mapping completely in spite of the
> added initial effort to craft the mapping (maybe alleviated by letting
> Teneo initially generate the mapping). However, this custom mapping xml
> adds another layer to understand and sometimes we are constrained by it
> if it doesnt expose all the features found in HBM for instance. I would
> be quite happier to write the mapping directly in HBM with the proper
> tuplizer elements, and what not, sprinkled in the xml. At least I am
> dealing with a mapping I understand and is extensively documented on the
> web.
> After taking a peek at the code, it seems that it is not possible to
> plug the Teneo runtime (tuplizer, collection adapters, etc) directly
> into hibernate hbm xml since the code assumes a PAnnotatedModel created,
> which implies traversing and processing EPackage and the issue found in
> 2). It would be great if these two layers (annotation and mapping
> generation, vs teneo runtime) were more independent so I could use just
> the runtime if I wanted. If this is not the case, would you have a
> simple example of how to create a plain HBM leveraging just the Teneo
> runtime?
>
> Of course, a solution for 2) would also help here.
>
> thanks,
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
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
Re: Manually creating persistence.xml or hbm.xml [message #514843 is a reply to message #514841] Tue, 16 February 2010 20:23 Go to previous message
Lemao  is currently offline Lemao Friend
Messages: 48
Registered: December 2009
Member
Apologies, Martin. I assumed that the CC would be associated with the whole thread. I will follow up from the EMF newsgroup (I actually not sure how I got here instead of the EMF one).
Re: Manually creating persistence.xml or hbm.xml [message #622154 is a reply to message #514611] Tue, 16 February 2010 08:08 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Lemao,
See comments inline.

btw, Teneo is supported on the main EMF newsgroup which I added in the cc.

gr. Martin

Lemao wrote:
> I have a somewhat large EMF model where I want to persist a subset of
> them using Teneo. Some of these persitent classes are somewhat
> independent and so easily made persistent with Teneo. However, I have a
> bunch of other EClasses that need to be partially persisted to the
> database if at all.
>
> 1) The first problem I am facing is that base EClass are considered top
> level entities even though their own purpose is for a proper in-memory
> abstraction. I am assuming that @MappedSubclass will solve this although
> I wasnt able to verify due to the next issue.
MT>> Yes @MappedSuperclass should solve this.
>
> 2) The next problem is that Teneo is, as expected, traversing all
> references in my model to things I dont want to persist. In some cases I
> dont want to persist a whole EClass and in some cases I dont want to
> persist a few references. Looking at the code I noticed that the
> top-level entity resolution takes into account the transient EMF
> property, but since my models are also written to files, I dont have the
> luxury of turning my EClasses or the specific references transient. I
> then came across adding @Transient annotation to EClass. After I added
> @Transient to all the EClasses I didnt want persisted to the db I still
> seems to traverse all references even though the EClasses have the
> @Transient annotation.
MT>> This should work as you expected. Did you regenerate the java source code after setting the annotation on the EClass?
You can also add the @Transient annotation in the EStructuralFeature to prevent persisting that specific feature.

>
> 3) I then thought that a good way to do this would be to take the
> mappings entirely into my hands. I grabbed a dump of the mappings
> generated by Teneo (I had a fairly independent part of the model
> persisted in Teneo), set the required PersistenceOptions to read from a
> file instead of auto generating and then manually added the mappings for
> the EClasses I wanted to persist and only the attributes/references I
> needed. Here I got exception in the EMFTuplizer. Is this possible, i.e.
> craft the mapping in Hibernate HBM or JPA persistence.xml entirely by hand?
> At this point I am not sure what to do and wondering if I am missing
> something obvious here?
MT>> Hmm, you got a dump of the mappings created by Teneo and then added your own eclasses, were those eclasses not
already present in the mapping?
What exception did you get?

>
> Thanks in advance,
>
> In addition, would it be possible to write my mappings directly in
> Hibernate hbm or JPA persistence.xml without using the mapping generation?
MT>> It can be done, but the easiest strategy is to let Teneo generate an initial mapping, store that in a hbm file and
then adapt this mapping manually if needed.
At runtime you need to use the Teneo runtime layer because Teneo adds logic to Hibernate to handle EMF specifics
(bi-directional lists, containment etc.)

>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
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
Re: Manually creating persistence.xml or hbm.xml [message #622160 is a reply to message #514640] Tue, 16 February 2010 14:55 Go to previous message
Lemao  is currently offline Lemao Friend
Messages: 48
Registered: December 2009
Member
Hi Martin,

Thanks for the comments!

> 2) The next problem is that Teneo is, as expected, traversing all
> references in my model to things I dont want to persist. In some cases I
> dont want to persist a whole EClass and in some cases I dont want to
> persist a few references. Looking at the code I noticed that the
> top-level entity resolution takes into account the transient EMF
> property, but since my models are also written to files, I dont have the
> luxury of turning my EClasses or the specific references transient. I
> then came across adding @Transient annotation to EClass. After I added
> @Transient to all the EClasses I didnt want persisted to the db I still
> seems to traverse all references even though the EClasses have the
> @Transient annotation.
MT>> This should work as you expected. Did you regenerate the java source code after setting the annotation on the EClass?
You can also add the @Transient annotation in the EStructuralFeature to prevent persisting that specific feature.

L>> It seems that there is a first pass that traverses all the EMF references reaching things like EMF XSD Schema, which is not annotated. I was expecting that @Transient on the opposite EClass or on the EReference would preclude Teneo from traversing the dependencies at all, but it seems that the traversal still happens and barfs if it reaches an EClass that is not annotated such as the EMFXSD Schema EClass. My problem is that I am forced to have persistence only on a parallel model without any references to things like EMF XSD.

> 3) I then thought that a good way to do this would be to take the
> mappings entirely into my hands. I grabbed a dump of the mappings
> generated by Teneo (I had a fairly independent part of the model
> persisted in Teneo), set the required PersistenceOptions to read from a
> file instead of auto generating and then manually added the mappings for
> the EClasses I wanted to persist and only the attributes/references I
> needed. Here I got exception in the EMFTuplizer. Is this possible, i.e.
> craft the mapping in Hibernate HBM or JPA persistence.xml entirely by hand?
> At this point I am not sure what to do and wondering if I am missing
> something obvious here?
MT>> Hmm, you got a dump of the mappings created by Teneo and then added your own eclasses, were those eclasses not
already present in the mapping? What exception did you get?

L>> Because of issue 2) I didnt add the extra EPackages for these to the HbDataStore and was hoping I could manually add the hbm mapping for the EClass. But after looking at the code, I noticed that it assumes that all persistent EClasses in the HBM to be processed are present in PAnnotatedModel. The exception was a NPE or something like that in EMFTuplizer after getting a null HbDataStore for the PersistentClass.

> In addition, would it be possible to write my mappings directly in
> Hibernate hbm or JPA persistence.xml without using the mapping generation?
MT>> It can be done, but the easiest strategy is to let Teneo generate an initial mapping, store that in a hbm file and
then adapt this mapping manually if needed.
At runtime you need to use the Teneo runtime layer because Teneo adds logic to Hibernate to handle EMF specifics
(bi-directional lists, containment etc.)

L>> I also read in the documentation that there is way to specify the persistence mapping using an external xml file. I do like this approach since it decouples the model from the mapping completely in spite of the added initial effort to craft the mapping (maybe alleviated by letting Teneo initially generate the mapping). However, this custom mapping xml adds another layer to understand and sometimes we are constrained by it if it doesnt expose all the features found in HBM for instance. I would be quite happier to write the mapping directly in HBM with the proper tuplizer elements, and what not, sprinkled in the xml. At least I am dealing with a mapping I understand and is extensively documented on the web.
After taking a peek at the code, it seems that it is not possible to plug the Teneo runtime (tuplizer, collection adapters, etc) directly into hibernate hbm xml since the code assumes a PAnnotatedModel created, which implies traversing and processing EPackage and the issue found in 2). It would be great if these two layers (annotation and mapping generation, vs teneo runtime) were more independent so I could use just the runtime if I wanted. If this is not the case, would you have a simple example of how to create a plain HBM leveraging just the Teneo runtime?

Of course, a solution for 2) would also help here.

thanks,
Re: Manually creating persistence.xml or hbm.xml [message #622164 is a reply to message #622160] Tue, 16 February 2010 20:07 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Lemao,
I will answer your post on the emf main newsgroup.

gr. Martin

Lemao wrote:
> Hi Martin,
> Thanks for the comments!
>
>> 2) The next problem is that Teneo is, as expected, traversing all
>> references in my model to things I dont want to persist. In some cases
>> I dont want to persist a whole EClass and in some cases I dont want to
>> persist a few references. Looking at the code I noticed that the
>> top-level entity resolution takes into account the transient EMF
>> property, but since my models are also written to files, I dont have
>> the luxury of turning my EClasses or the specific references
>> transient. I then came across adding @Transient annotation to EClass.
>> After I added @Transient to all the EClasses I didnt want persisted to
>> the db I still seems to traverse all references even though the
>> EClasses have the @Transient annotation.
> MT>> This should work as you expected. Did you regenerate the java
> source code after setting the annotation on the EClass?
> You can also add the @Transient annotation in the EStructuralFeature to
> prevent persisting that specific feature.
>
> L>> It seems that there is a first pass that traverses all the EMF
> references reaching things like EMF XSD Schema, which is not annotated.
> I was expecting that @Transient on the opposite EClass or on the
> EReference would preclude Teneo from traversing the dependencies at all,
> but it seems that the traversal still happens and barfs if it reaches an
> EClass that is not annotated such as the EMFXSD Schema EClass. My
> problem is that I am forced to have persistence only on a parallel model
> without any references to things like EMF XSD.
>
>> 3) I then thought that a good way to do this would be to take the
>> mappings entirely into my hands. I grabbed a dump of the mappings
>> generated by Teneo (I had a fairly independent part of the model
>> persisted in Teneo), set the required PersistenceOptions to read from
>> a file instead of auto generating and then manually added the mappings
>> for the EClasses I wanted to persist and only the
>> attributes/references I needed. Here I got exception in the
>> EMFTuplizer. Is this possible, i.e. craft the mapping in Hibernate HBM
>> or JPA persistence.xml entirely by hand?
>> At this point I am not sure what to do and wondering if I am missing
>> something obvious here?
> MT>> Hmm, you got a dump of the mappings created by Teneo and then added
> your own eclasses, were those eclasses not already present in the
> mapping? What exception did you get?
>
> L>> Because of issue 2) I didnt add the extra EPackages for these to the
> HbDataStore and was hoping I could manually add the hbm mapping for the
> EClass. But after looking at the code, I noticed that it assumes that
> all persistent EClasses in the HBM to be processed are present in
> PAnnotatedModel. The exception was a NPE or something like that in
> EMFTuplizer after getting a null HbDataStore for the PersistentClass.
>
>> In addition, would it be possible to write my mappings directly in
>> Hibernate hbm or JPA persistence.xml without using the mapping
>> generation?
> MT>> It can be done, but the easiest strategy is to let Teneo generate
> an initial mapping, store that in a hbm file and then adapt this mapping
> manually if needed.
> At runtime you need to use the Teneo runtime layer because Teneo adds
> logic to Hibernate to handle EMF specifics (bi-directional lists,
> containment etc.)
>
> L>> I also read in the documentation that there is way to specify the
> persistence mapping using an external xml file. I do like this approach
> since it decouples the model from the mapping completely in spite of the
> added initial effort to craft the mapping (maybe alleviated by letting
> Teneo initially generate the mapping). However, this custom mapping xml
> adds another layer to understand and sometimes we are constrained by it
> if it doesnt expose all the features found in HBM for instance. I would
> be quite happier to write the mapping directly in HBM with the proper
> tuplizer elements, and what not, sprinkled in the xml. At least I am
> dealing with a mapping I understand and is extensively documented on the
> web.
> After taking a peek at the code, it seems that it is not possible to
> plug the Teneo runtime (tuplizer, collection adapters, etc) directly
> into hibernate hbm xml since the code assumes a PAnnotatedModel created,
> which implies traversing and processing EPackage and the issue found in
> 2). It would be great if these two layers (annotation and mapping
> generation, vs teneo runtime) were more independent so I could use just
> the runtime if I wanted. If this is not the case, would you have a
> simple example of how to create a plain HBM leveraging just the Teneo
> runtime?
>
> Of course, a solution for 2) would also help here.
>
> thanks,
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
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
Re: Manually creating persistence.xml or hbm.xml [message #622165 is a reply to message #622164] Tue, 16 February 2010 20:23 Go to previous message
Lemao  is currently offline Lemao Friend
Messages: 48
Registered: December 2009
Member
Apologies, Martin. I assumed that the CC would be associated with the whole thread. I will follow up from the EMF newsgroup (I actually not sure how I got here instead of the EMF one).
Previous Topic:[EEFT] How to constrain forms?
Next Topic:[EMF Compare] OPTION_DISTINCT_METAMODELS XML files
Goto Forum:
  


Current Time: Thu Apr 18 12:50:22 GMT 2024

Powered by FUDForum. Page generated in 0.02603 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top