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 #622147] Mon, 15 February 2010 23:33
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?
Previous Topic:EcoreTools cannot be installed on Eclipse 3.6 M4
Next Topic:[EEF] Databinding and non-SWT UIs
Goto Forum:
  


Current Time: Fri Apr 26 14:27:23 GMT 2024

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

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

Back to the top