You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Andrey Gura <ag...@apache.org> on 2017/03/09 11:03:45 UTC

Re: generic class support

Generics are compile time. You should know what types will be used in
runtime and configure indexing accordingly to this knowledge. If your
entires can contain different types just use java.lang.Object.

On Thu, Mar 9, 2017 at 4:37 AM, shawn.du <sh...@neulion.com.cn> wrote:
> Hi,
>
> see below configuration:
> <bean class="org.apache.ignite.configuration.CacheConfiguration">
>          <property name="name" value="cacheName"/>
>          <property name="indexedTypes">
>              <list>
>                      <value>java.lang.String</value>
>                      <value>com.example.MyClass</value>
>               </list>
>          </property>
> </bean>
>
> MyClass is a generic class.  T can be Integer/Long/byte[]/String etc simple
> data type.
>
> public class MyClass<T>
> {
>     @QuerySqlField
>      private T value;
> }
>
> Does ignite support?
>
> Thanks
> Shawn
>