| Need Help about ODA Ecore [message #636180] |
Fri, 29 October 2010 10:46  |
Romain Bioteau Messages: 59 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 04:00   |
Romain Bioteau Messages: 59 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
|
|
|
|
Powered by
FUDForum. Page generated in 0.04954 seconds