You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ignite.apache.org by Alexey Kuznetsov <ak...@gridgain.com> on 2015/11/24 09:39:11 UTC

@QuerySqlField is incompatible in ignite 1.5 with 1.4 when set on method

Igniters,

I have such class in ignite-1.4

class Test(
    @Id @ScalaCacheQuerySqlField(index = true) val id: Long = 0L,
    val name: String = null,
    aStatus: ListStatus,
    val ruleID: Long = 0L) extends Serializable {
    private val intStatus = enumToByte(aStatus)

    @ScalaCacheQuerySqlField(index = true) def status: ListStatus =
        byteToEnum(ListStatus.values, intStatus)
}

As part of my tests of upcoming ignite 1.5 I run my code and get exception
like this:

Caused by: class org.apache.ignite.IgniteCheckedException: Failed to
initialize property 'status' for key class 'class java.lang.Long'
 and value class 'class my.tester.sql.Test'. Make sure that one of these
classes contains respective getter method or field.
at
org.apache.ignite.internal.processors.query.GridQueryProcessor.buildClassProperty(GridQueryProcessor.java:1512)
at
org.apache.ignite.internal.processors.query.GridQueryProcessor.processClassMeta(GridQueryProcessor.java:1393)
at
org.apache.ignite.internal.processors.query.GridQueryProcessor.initializeCache(GridQueryProcessor.java:241)
at
org.apache.ignite.internal.processors.query.GridQueryProcessor.onCacheStart(GridQueryProcessor.java:374)
at
org.apache.ignite.internal.processors.cache.GridCacheProcessor.startCache(GridCacheProcessor.java:1015)
at
org.apache.ignite.internal.processors.cache.GridCacheProcessor.onKernalStart(GridCacheProcessor.java:786)

After some debug I found that GridQueryProcessor tries to find method with
"get", but I have method without "get" in name.

I think we should add support for such use case, when user declare
getters/setters without using "get/set" prefixes.

Thoughts?

-- 
Alexey Kuznetsov
GridGain Systems
www.gridgain.com

Re: @QuerySqlField is incompatible in ignite 1.5 with 1.4 when set on method

Posted by Alexey Kuznetsov <ak...@gridgain.com>.
Thanks, Alex.

Could you tell at what branch you will add this?
Will you create an issue that I could track?

On Tue, Nov 24, 2015 at 8:59 PM, Alexey Goncharuk <
alexey.goncharuk@gmail.com> wrote:

> I will add the check for non-get-named method if there are no objections, I
> see no reason for not having it.
>
> 2015-11-24 13:25 GMT+03:00 Roman Shtykh <rs...@yahoo.com.invalid>:
>
> > +1 for adding support, particularly because in Scala we don't necessarily
> > have get... and set... (an underscore can be used for that).
> >
> > Roman
> >
> >
> >
> > On Tuesday, November 24, 2015 5:39 PM, Alexey Kuznetsov <
> > akuznetsov@gridgain.com> wrote:
> > Igniters,
> >
> > I have such class in ignite-1.4
> >
> > class Test(
> >     @Id @ScalaCacheQuerySqlField(index = true) val id: Long = 0L,
> >     val name: String = null,
> >     aStatus: ListStatus,
> >     val ruleID: Long = 0L) extends Serializable {
> >     private val intStatus = enumToByte(aStatus)
> >
> >     @ScalaCacheQuerySqlField(index = true) def status: ListStatus =
> >         byteToEnum(ListStatus.values, intStatus)
> > }
> >
> > As part of my tests of upcoming ignite 1.5 I run my code and get
> exception
> > like this:
> >
> > Caused by: class org.apache.ignite.IgniteCheckedException: Failed to
> > initialize property 'status' for key class 'class java.lang.Long'
> > and value class 'class my.tester.sql.Test'. Make sure that one of these
> > classes contains respective getter method or field.
> > at
> >
> >
> org.apache.ignite.internal.processors.query.GridQueryProcessor.buildClassProperty(GridQueryProcessor.java:1512)
> > at
> >
> >
> org.apache.ignite.internal.processors.query.GridQueryProcessor.processClassMeta(GridQueryProcessor.java:1393)
> > at
> >
> >
> org.apache.ignite.internal.processors.query.GridQueryProcessor.initializeCache(GridQueryProcessor.java:241)
> > at
> >
> >
> org.apache.ignite.internal.processors.query.GridQueryProcessor.onCacheStart(GridQueryProcessor.java:374)
> > at
> >
> >
> org.apache.ignite.internal.processors.cache.GridCacheProcessor.startCache(GridCacheProcessor.java:1015)
> > at
> >
> >
> org.apache.ignite.internal.processors.cache.GridCacheProcessor.onKernalStart(GridCacheProcessor.java:786)
> >
> > After some debug I found that GridQueryProcessor tries to find method
> with
> > "get", but I have method without "get" in name.
> >
> > I think we should add support for such use case, when user declare
> > getters/setters without using "get/set" prefixes.
> >
> > Thoughts?
> >
> > --
> > Alexey Kuznetsov
> > GridGain Systems
> > www.gridgain.com
> >
>



-- 
Alexey Kuznetsov
GridGain Systems
www.gridgain.com

Re: @QuerySqlField is incompatible in ignite 1.5 with 1.4 when set on method

Posted by Alexey Goncharuk <al...@gmail.com>.
I will add the check for non-get-named method if there are no objections, I
see no reason for not having it.

2015-11-24 13:25 GMT+03:00 Roman Shtykh <rs...@yahoo.com.invalid>:

> +1 for adding support, particularly because in Scala we don't necessarily
> have get... and set... (an underscore can be used for that).
>
> Roman
>
>
>
> On Tuesday, November 24, 2015 5:39 PM, Alexey Kuznetsov <
> akuznetsov@gridgain.com> wrote:
> Igniters,
>
> I have such class in ignite-1.4
>
> class Test(
>     @Id @ScalaCacheQuerySqlField(index = true) val id: Long = 0L,
>     val name: String = null,
>     aStatus: ListStatus,
>     val ruleID: Long = 0L) extends Serializable {
>     private val intStatus = enumToByte(aStatus)
>
>     @ScalaCacheQuerySqlField(index = true) def status: ListStatus =
>         byteToEnum(ListStatus.values, intStatus)
> }
>
> As part of my tests of upcoming ignite 1.5 I run my code and get exception
> like this:
>
> Caused by: class org.apache.ignite.IgniteCheckedException: Failed to
> initialize property 'status' for key class 'class java.lang.Long'
> and value class 'class my.tester.sql.Test'. Make sure that one of these
> classes contains respective getter method or field.
> at
>
> org.apache.ignite.internal.processors.query.GridQueryProcessor.buildClassProperty(GridQueryProcessor.java:1512)
> at
>
> org.apache.ignite.internal.processors.query.GridQueryProcessor.processClassMeta(GridQueryProcessor.java:1393)
> at
>
> org.apache.ignite.internal.processors.query.GridQueryProcessor.initializeCache(GridQueryProcessor.java:241)
> at
>
> org.apache.ignite.internal.processors.query.GridQueryProcessor.onCacheStart(GridQueryProcessor.java:374)
> at
>
> org.apache.ignite.internal.processors.cache.GridCacheProcessor.startCache(GridCacheProcessor.java:1015)
> at
>
> org.apache.ignite.internal.processors.cache.GridCacheProcessor.onKernalStart(GridCacheProcessor.java:786)
>
> After some debug I found that GridQueryProcessor tries to find method with
> "get", but I have method without "get" in name.
>
> I think we should add support for such use case, when user declare
> getters/setters without using "get/set" prefixes.
>
> Thoughts?
>
> --
> Alexey Kuznetsov
> GridGain Systems
> www.gridgain.com
>

Re: @QuerySqlField is incompatible in ignite 1.5 with 1.4 when set on method

Posted by Roman Shtykh <rs...@yahoo.com.INVALID>.
+1 for adding support, particularly because in Scala we don't necessarily have get... and set... (an underscore can be used for that).

Roman



On Tuesday, November 24, 2015 5:39 PM, Alexey Kuznetsov <ak...@gridgain.com> wrote:
Igniters,

I have such class in ignite-1.4

class Test(
    @Id @ScalaCacheQuerySqlField(index = true) val id: Long = 0L,
    val name: String = null,
    aStatus: ListStatus,
    val ruleID: Long = 0L) extends Serializable {
    private val intStatus = enumToByte(aStatus)

    @ScalaCacheQuerySqlField(index = true) def status: ListStatus =
        byteToEnum(ListStatus.values, intStatus)
}

As part of my tests of upcoming ignite 1.5 I run my code and get exception
like this:

Caused by: class org.apache.ignite.IgniteCheckedException: Failed to
initialize property 'status' for key class 'class java.lang.Long'
and value class 'class my.tester.sql.Test'. Make sure that one of these
classes contains respective getter method or field.
at
org.apache.ignite.internal.processors.query.GridQueryProcessor.buildClassProperty(GridQueryProcessor.java:1512)
at
org.apache.ignite.internal.processors.query.GridQueryProcessor.processClassMeta(GridQueryProcessor.java:1393)
at
org.apache.ignite.internal.processors.query.GridQueryProcessor.initializeCache(GridQueryProcessor.java:241)
at
org.apache.ignite.internal.processors.query.GridQueryProcessor.onCacheStart(GridQueryProcessor.java:374)
at
org.apache.ignite.internal.processors.cache.GridCacheProcessor.startCache(GridCacheProcessor.java:1015)
at
org.apache.ignite.internal.processors.cache.GridCacheProcessor.onKernalStart(GridCacheProcessor.java:786)

After some debug I found that GridQueryProcessor tries to find method with
"get", but I have method without "get" in name.

I think we should add support for such use case, when user declare
getters/setters without using "get/set" prefixes.

Thoughts?

-- 
Alexey Kuznetsov
GridGain Systems
www.gridgain.com