|
|
|
|
Re: [query2] How may I do a query on attribute values using regexp? [message #656365 is a reply to message #656351] |
Fri, 25 February 2011 10:10 |
manasa Messages: 32 Registered: October 2010 |
Member |
|
|
Fabrizio Casali wrote on Fri, 25 February 2011 04:19 | Thank you for your kind reply.
It's a useful hint, but it raises new questions.
You have mentioned a "query editor": do you mean that the Query2 plugin comes with its own editor?
| Yes
Quote: | If so how can I use it?
| You can create a .query file in your workspace, provided the following plugins are present in your development workspace.
org.eclipse.emf.query2.stringsyntax.ui
org.eclipse.emf.query2.stringsyntax.tools.ui
org.eclipse.emf.query2.stringsyntax
You could then import your the namespace URI of the epackage, as the first line, which will be followed by queries, like below
import "http://eclipse.org/modeling/emf/query/1.0.0"
AllPersonNoJoinsAndNoNests:
from Person withoutsubtypes as p
select p where p.name like 'kolb*'
You could then run the query using the context menu, and selecting the query---->Run Query.
Alternatively you could open Query View where all the queries will be listed, you can execute the queries from there.
Quote: | What wild-char are supported other then *?
|
Presently only * is supported.
Quote: |
I need to generate queries dynamically. If I opt for the object base query format I cannot use patterns delimited by single quotes, so how can I switch to and from a case sensitive query? Alternatively, the sql format allows parameters in queries?
|
Sorry, that was a mistake from my side, in the object based query format,
you will have to specify the pattern within double quotes.
Also, it is possible to use parameters in queries, and replace them accordingly in your implementation.
You could refer to the below link for details on it.
http://www.eclipse.org/forums/index.php?t=msg&th=198593& amp; amp;start=0&S=6611ff721c0273e3462494026d3f04e9
Regards,
Manasa
[Updated on: Fri, 25 February 2011 10:13] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.04228 seconds