Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » DTP » Need Help about ODA Ecore
Need Help about ODA Ecore [message #636180] Fri, 29 October 2010 14:46 Go to next message
Romain Bioteau is currently offline Romain BioteauFriend
Messages: 65
Registered: August 2009
Location: Grenoble
Member
Hi,
I would like to use this driver with Birt to directly query my model.
I tried to follow this tutorial : http://timezra.blogspot.com/2008/04/oda-ecore-getting-starte d-guide.html

However, I'm stuck with the dataset creation. Although my file : "myfile.mydomain" is pinged correctly, the wizard doesn't find any column and any ocl context.

I'm on Helios , with the org.eclipse.datatools.enablement.oda.ecore.feature_1.9.0.v20 1010181130
and birt 2.6.1

Did someone encounter this issue ?

Thanks for any help
BR

Romain


R&D Engineer at BonitaSoft
Re: Need Help about ODA Ecore [message #637876 is a reply to message #636180] Tue, 09 November 2010 09:00 Go to previous messageGo to next message
Romain Bioteau is currently offline Romain BioteauFriend
Messages: 65
Registered: August 2009
Location: Grenoble
Member
Hi everybody,
I found a trick to resolve my issue.

In plugin org.eclipse.datatools.enablement.oda.ecore.ui, there is the class org.eclipse.datatools.enablement.oda.ecore.util.EPackageUtil :

Here is the content of the modified code :
Original code :
public static Set<EPackage> getPackagesForModel(final Properties dataSourceProperties) throws OdaException {
		final Collection<EObject> model = Connection.getModel(dataSourceProperties);
		if (model.isEmpty()) {
			return null;
		}
	
		EObjectCondition condition = new EObjectTypeRelationCondition(EcorePackage.eINSTANCE.getEObject(),
				TypeRelation.SAMETYPE_OR_SUBTYPE_LITERAL);
		IQueryResult classes = new SELECT(
				new FROM(model.iterator().next()),
				new WHERE(condition)).execute();
		Set<EObject> objects = (Set<EObject>)classes.getEObjects();
		Set<EPackage> ePackages = new HashSet<EPackage>();
		for (EObject eObject : objects) {
			ePackages.add(eObject.eClass().getEPackage());
		}
		return ePackages;
	}


Hacked code :
...
EObjectCondition condition  = EObjectTypeRelationCondition.UNDEFINED;
...


This method use to always return an empty Set for my model file and setting the condition to EObjectTypeRelationCondition.UNDIFINED in the emf query returns all my EObjects and let me browse all my model objects.

As I'm not familar at all with EMF Query, I'm not able to say if it's a bug or not.
However I'll love to have some explanation on the purpuse of TypeRelation.SAMETYPE_OR_SUBTYPE_LITERAL as condition...

HTH
Romain


R&D Engineer at BonitaSoft
Re: Need Help about ODA Ecore [message #660831 is a reply to message #636180] Mon, 21 March 2011 20:31 Go to previous message
GILLES  élios is currently offline GILLES éliosFriend
Messages: 7
Registered: March 2011
Junior Member
Ok thx for the tips i'll try that at work tomorrow but someone could take a look at it to know if there is a better way to deal with that prob ?
Previous Topic:How can I import ModelBase package into my own application?
Next Topic:SQL Editor -Update Connection Profile programmatic way
Goto Forum:
  


Current Time: Fri Apr 26 05:28:53 GMT 2024

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

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

Back to the top