Skip to main content



      Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Problem using generated hibernate mapping file
Problem using generated hibernate mapping file [message #609563] Tue, 28 August 2007 07:27
Eclipse UserFriend
Hello,

i want to use a self-generated mapping file because i have to change it a
litte.
My problem is that teneo don't find this file. I activated the

PersistenceOptions.USE_MAPPING_FILE,"true") and set the Properties in the
HbDataStore. My hibernate.hbm.xml is in the root of the classpath.

I also tried it with

PersistenceOptions.PERSISTENCE_XML,"absolutePath or relativePath ");
Both doesn't work.

I use teneo 0.8 and eclipse3.3. The hibernate.hbm.xml file was generated
with:
String mappingString =
HbHelper.INSTANCE.generateMapping(ePackages,persistenceOptio ns);

My code for the DataStore-initialization:

final String dataStoreName = "bpel20";
final HbDataStore dataStore = (HbDataStore) HbHelper.INSTANCE
.createRegisterDataStore(dataStoreName);
Properties hibernateProperties = new Properties();
hibernateProperties.setProperty(Environment.DRIVER,
"org.postgresql.Driver");
hibernateProperties.setProperty(Environment.USER, "postgres");
hibernateProperties.setProperty(Environment.URL,
"jdbc:postgresql://127.0.0.1:5432/bpel20");
hibernateProperties.setProperty(Environment.PASS, "XXXXX");
hibernateProperties.setProperty(Environment.DIALECT,
"org.hibernate.dialect.PostgreSQLDialect");
dataStore.setHibernateProperties(hibernateProperties);
Properties persistenceOptions = new Properties();
persistenceOptions.setProperty(PersistenceOptions.INHERITANC E_MAPPING,
"JOINED");
persistenceOptions.setProperty(
PersistenceOptions.FETCH_CONTAINMENT_EAGERLY,true");
persistenceOptions.setProperty(PersistenceOptions.SET_CASCAD E_ALL_ON_CONTAINMENT,
"true");
persistenceOptions.setProperty(PersistenceOptions.USE_MAPPIN G_FILE,
"true");
persistenceOptions.setProperty(PersistenceOptions.PERSISTENC E_XML,
"");
dataStore.setPersistenceProperties(persistenceOptions);
dataStore.initialize();

With kind regards

Daniel Gerlach
Previous Topic:[CDO] Hanging (client)
Next Topic:[CDO] Hanging (client)
Goto Forum:
  


Current Time: Mon Jul 07 09:59:48 EDT 2025

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

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

Back to the top