Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "EMF/Query2/DevGuide"
(New page: EMF Query2 Developer Guide == Installation == == Overview of Query2 == = Using Query2 =) |
|||
Line 4: | Line 4: | ||
== Overview of Query2 == | == Overview of Query2 == | ||
+ | Query2 provides easy mechanism to query emf metadata with minimal loading of resources. Query2 has an in-built indexing mechanism which indexes types, resources and references. This data is used during query execution and hence avoiding loading of resources wherever needed. | ||
+ | Hence, if you want to use query2, you are mandatorily required to setup indexing. After that you can use it execute queries. We will see how to set it up in later sections. | ||
+ | Query2 also provides you different ways to specify queries. We will see them in coming sections. | ||
= Using Query2 = | = Using Query2 = | ||
+ | == Setting up Indexes == | ||
+ | ''' Step 1 ''' Create dependency to index plugin: Add dependency to the plugins | ||
+ | # org.eclipse.emf.query.index.ui | ||
+ | # org.eclipse.emf.query.index | ||
+ | |||
+ | ''' Step 2 ''' Using Indexing api: | ||
+ | To index the resources, you can use IndexFactory as the starting point. It is a singleton class, which can keep the index for your complete workspace. | ||
+ | Following is code sample to index new resource: |
Revision as of 06:05, 16 November 2010
EMF Query2 Developer Guide
Installation
Overview of Query2
Query2 provides easy mechanism to query emf metadata with minimal loading of resources. Query2 has an in-built indexing mechanism which indexes types, resources and references. This data is used during query execution and hence avoiding loading of resources wherever needed. Hence, if you want to use query2, you are mandatorily required to setup indexing. After that you can use it execute queries. We will see how to set it up in later sections. Query2 also provides you different ways to specify queries. We will see them in coming sections.
Using Query2
Setting up Indexes
Step 1 Create dependency to index plugin: Add dependency to the plugins
- org.eclipse.emf.query.index.ui
- org.eclipse.emf.query.index
Step 2 Using Indexing api: To index the resources, you can use IndexFactory as the starting point. It is a singleton class, which can keep the index for your complete workspace. Following is code sample to index new resource: