ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sergi Vladykin <sergi.vlady...@gmail.com>
Subject Re: QuerySqlField on a Java.util.map ?
Date Tue, 22 Sep 2015 09:07:18 GMT
Hi,

Yes, you can annotate `identifiers` with @QuerySqlField.
To search within the contents you can use User defined functions (see
https://ignite.apache.org/releases/1.3.0/javadoc/org/apache/ignite/cache/query/annotations/QuerySqlFunction.html
)

For example create function `get` like below and use in query like: SELECT
_VAL FROM Resolve where get(identifiers, ?) = ?
Though you will not be able to use indexes this way.

@QuerySqlFunction

public static String get(Map<IdentifierEnum, String> identifiers,
IdentifierEnum id) {

     return identifiers.get(id);

}

Sergi



2015-09-22 11:18 GMT+03:00 endian675 <mike@griggs.org.uk>:

> If I have a class declared as follows:
>
>    public class Resolve
>    {
>        public Map<IdentifierEnum, String> identifiers;
>    }
>
> is it possible to add a @QuerySqlField attribute to the identifiers
> field, but search within the *contents *of that field via a SQL query?
> ------------------------------
> View this message in context: QuerySqlField on a Java.util.map ?
> <http://apache-ignite-users.70518.x6.nabble.com/QuerySqlField-on-a-Java-util-map-tp1458.html>
> Sent from the Apache Ignite Users mailing list archive
> <http://apache-ignite-users.70518.x6.nabble.com/> at Nabble.com.
>

Mime
View raw message