Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 327905 - Problems running example "org.eclipse.emf.teneo.hibernate.examples"
Summary: Problems running example "org.eclipse.emf.teneo.hibernate.examples"
Status: CLOSED INVALID
Alias: None
Product: EMF
Classification: Modeling
Component: Teneo (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Martin Taal CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-15 11:24 EDT by tenor CLA
Modified: 2010-10-18 08:25 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tenor CLA 2010-10-15 11:24:48 EDT
Build Identifier: 

MANIFEST.MF is 


Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.emf.teneo.hibernate.examples;singleton:=true
Bundle-Version: 1.0.0
Bundle-ClassPath: .
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Export-Package: org.eclipse.emf.teneo.hibernate.examples;version="1.0.0",
 org.eclipse.emf.teneo.hibernate.examples.extlibrary;version="1.0.0",
 org.eclipse.emf.teneo.hibernate.examples.extlibrary.impl;version="1.0.0",
 org.eclipse.emf.teneo.hibernate.examples.extlibrary.util;version="1.0.0"
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
 org.eclipse.emf.ecore;bundle-version="[2.5.0,3.0.0)",
 org.eclipse.emf.ecore.xmi;bundle-version="[2.5.0,3.0.0)",
 org.eclipse.emf.teneo.hibernate;bundle-version="[1.0.0,2.0.0)",
 org.hibernate;bundle-version="[3.3.2,4.0.0)";resolution:=optional,
 org.eclipse.emf.ecore.change;bundle-version="[2.5.0,3.0.0)";resolution:=optional,
 org.apache.commons.logging;bundle-version="[1.0.0,2.0.0)";resolution:=optional,
 org.dom4j;bundle-version="[1.0.0,2.0.0)";resolution:=optional,
 org.hsqldb;bundle-version="[1.0.0,2.0.0)";resolution:=optional,
 com.mysql.jdbc;bundle-version="[4.0.0,6.0.0)";resolution:=optional
Bundle-ActivationPolicy: lazy


I am getting classpath not found for *.java to run and all have main().
so how to go about it? How to run?


Reproducible: Always
Comment 1 Martin Taal CLA 2010-10-15 11:32:00 EDT
Sorry, I am going to reject this issue. The problems you are having seem to be basic java project setup issues which you should be able to solve as a java programmer.

gr. Martin
Comment 2 tenor CLA 2010-10-18 08:25:38 EDT
I am trying to modify my project code on the lines of 

package teneotest;

import java.util.Properties;
import orders.Customer;
import orders.OrdersPackage;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.teneo.hibernate.HbDataStore;
import org.eclipse.emf.teneo.hibernate.HbHelper;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.cfg.Environment;



public class EmfTeneoHibernate {
	
	@SuppressWarnings("deprecation")
	public static void main(String[]args)
	{
	
	
	HbDataStore hbds = (HbDataStore)HbHelper.INSTANCE.createRegisterDataStore("MyDb");
		//HbDataStore hbds = (HbDataStore)HbHelper.INSTANCE.
	

	final Properties props = new Properties();
    
	props.setProperty(Environment.DRIVER, "oracle.jdbc.OracleDriver");
	props.setProperty(Environment.URL, "jdbc:oracle:thin:@158.234.90.17:1521:dev01");
	props.setProperty(Environment.USER, "kumara");
	props.setProperty(Environment.PASS, "password");
	//props.setProperty(Environment.DIALECT, org.hibernate.dialect.MySQLInnoDBDialect.class.getName());
	props.setProperty(Environment.DIALECT, org.hibernate.dialect.OracleDialect.class.getName());
	props.setProperty(Environment.SHOW_SQL, "true");
	
	hbds.setProperties(props);

	hbds.setEPackages(new EPackage[]{OrdersPackage.eINSTANCE});
	hbds.initialize();
	SessionFactory sessionFactory = hbds.getSessionFactory();
	Session session = sessionFactory.openSession();
	Transaction tx = session.beginTransaction();
	//tx.begin();
	Customer customer = OrdersPackage.eINSTANCE.getOrdersFactory().createCustomer();
	customer.setCode("0023485");
	session.save(customer);
	System.out.println("The generated XML is : "+ hbds.getMappingXML().toString());


	tx.commit();
	session.close();
	System.out.println("The customer details are :-- " + customer.getCode());



}

}

This code has worked and wanted to modify it using our domain objects but i notice two things 

1)hbds.setEPackages...
2) OrdersPackage.eINSTANCE.getOrdersFactory

Whic are missing so far in our EMF generated model , all i want to know 
are Epackage and Factory are mandatory as even in the link below it says about registering for Epackage so that Teneo can work 
ie
A number of EPackages have to be registered with Teneo to persist.

Plz reply and help out. Appreciate it.
Thanks.