Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "EMF/Query2/DevGuide"

< EMF‎ | Query2
(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

  1. org.eclipse.emf.query.index.ui
  2. 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:

Copyright © Eclipse Foundation, Inc. All Rights Reserved.