[jira] Created: (ESPER-405) Equals operator on object types in expressions should support inheritance

View: New views
11 Messages — Rating Filter:   Alert me  

[jira] Created: (ESPER-405) Equals operator on object types in expressions should support inheritance

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Equals operator on object types in expressions should support inheritance
-------------------------------------------------------------------------

                 Key: ESPER-405
                 URL: http://jira.codehaus.org/browse/ESPER-405
             Project: Esper
          Issue Type: Wish
          Components: Core
    Affects Versions: 3.2
         Environment: winxp jdk6 esper-3.2
            Reporter: Frederic
         Attachments: EsperTestObject.java

As you can see in the attached example, if I define a statement like: _select * from MyEvent where key = ?_ for which MyEvent.Key returns an interface, since the parameter given to the prepared statement is obviously a concrete object of this type, I hit a statement compilation error:

Exception in thread "main" com.espertech.esper.client.EPStatementException: Unexpected error compiling statement: java.lang.IllegalStateException:Coercion type class java.lang.Object not numeric [select * from EsperTestObject$MyEvent where (key = EsperTestObject$MyObjectKey@1df5a8f)]
        at com.espertech.esper.core.StatementLifecycleSvcImpl.compile(StatementLifecycleSvcImpl.java:841)
        at com.espertech.esper.core.StatementLifecycleSvcImpl.createStopped(StatementLifecycleSvcImpl.java:180)
        at com.espertech.esper.core.StatementLifecycleSvcImpl.createAndStart(StatementLifecycleSvcImpl.java:153)
        at com.espertech.esper.core.StatementLifecycleSvcImpl.createAndStart(StatementLifecycleSvcImpl.java:113)
        at com.espertech.esper.core.EPAdministratorImpl.create(EPAdministratorImpl.java:226)
        at com.espertech.esper.core.EPAdministratorImpl.create(EPAdministratorImpl.java:231)
        at EsperTestObject.start(EsperTestObject.java:18)
        at EsperTestObject.main(EsperTestObject.java:56)

I know this has already been discussed in ESPER-114, but I find really counter intuitive that you can only compare object of the exact same type. IMHO, if object comparison is supported in the statement, it should not narrow the normal behavior of java.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Commented: (ESPER-405) Equals operator on object types in expressions should support inheritance

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ http://jira.codehaus.org/browse/ESPER-405?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=194265#action_194265 ]

Thomas Bernhardt commented on ESPER-405:
----------------------------------------

Esper has support for instanceOf, in Java the "=" would also not compile?

> Equals operator on object types in expressions should support inheritance
> -------------------------------------------------------------------------
>
>                 Key: ESPER-405
>                 URL: http://jira.codehaus.org/browse/ESPER-405
>             Project: Esper
>          Issue Type: Wish
>          Components: Core
>    Affects Versions: 3.2
>         Environment: winxp jdk6 esper-3.2
>            Reporter: Frederic
>         Attachments: EsperTestObject.java
>
>
> As you can see in the attached example, if I define a statement like: _select * from MyEvent where key = ?_ for which MyEvent.Key returns an interface, since the parameter given to the prepared statement is obviously a concrete object of this type, I hit a statement compilation error:
> Exception in thread "main" com.espertech.esper.client.EPStatementException: Unexpected error compiling statement: java.lang.IllegalStateException:Coercion type class java.lang.Object not numeric [select * from EsperTestObject$MyEvent where (key = EsperTestObject$MyObjectKey@1df5a8f)]
> at com.espertech.esper.core.StatementLifecycleSvcImpl.compile(StatementLifecycleSvcImpl.java:841)
> at com.espertech.esper.core.StatementLifecycleSvcImpl.createStopped(StatementLifecycleSvcImpl.java:180)
> at com.espertech.esper.core.StatementLifecycleSvcImpl.createAndStart(StatementLifecycleSvcImpl.java:153)
> at com.espertech.esper.core.StatementLifecycleSvcImpl.createAndStart(StatementLifecycleSvcImpl.java:113)
> at com.espertech.esper.core.EPAdministratorImpl.create(EPAdministratorImpl.java:226)
> at com.espertech.esper.core.EPAdministratorImpl.create(EPAdministratorImpl.java:231)
> at EsperTestObject.start(EsperTestObject.java:18)
> at EsperTestObject.main(EsperTestObject.java:56)
> I know this has already been discussed in ESPER-114, but I find really counter intuitive that you can only compare object of the exact same type. IMHO, if object comparison is supported in the statement, it should not narrow the normal behavior of java.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Commented: (ESPER-405) Equals operator on object types in expressions should support inheritance

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ http://jira.codehaus.org/browse/ESPER-405?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=194268#action_194268 ]

Frederic commented on ESPER-405:
--------------------------------

Not sure that I have explained myself clearly. In java, I can always do obj1.equals(obj2) even if obj1 is hidden behind an interface and obj2 would be known as the concrete class. Indeed we can apply equals on whatever objects...

And I cannot see how the instanceof can help at this point since anyway the objects used to filter are presented under an Interface and I might not even know at runtime what are their implementation. The idea is to ensure that the statement is triggered if the "getKey()" of the MyEvent sent 20K times to esper is the same object as the one which parametrized the statement, whatever its concrete class (by doing obj1.equals(obj2) ) .

If we simplify a bit my example (attached EsperTestConcreteObject.java) by removing the IKey interface to compare directly the concrete classes and not the interface (MyKey instead of IKey) , Esper would do the correct filtering and trigger my statement (as defined in ESPER-114). Why Esper do not support inheritance when compiling its statement? At the end whatever the object defined in the statement, it is just a matter of doing a java equality test on it.

I know I could bypass this by defining a custom method:
select * from MyEvent(Equality.eq(key, ?))

And that would obviously work but it makes the statement a bit clumsy.

> Equals operator on object types in expressions should support inheritance
> -------------------------------------------------------------------------
>
>                 Key: ESPER-405
>                 URL: http://jira.codehaus.org/browse/ESPER-405
>             Project: Esper
>          Issue Type: Wish
>          Components: Core
>    Affects Versions: 3.2
>         Environment: winxp jdk6 esper-3.2
>            Reporter: Frederic
>         Attachments: EsperTestConcreteObject.java, EsperTestObject.java
>
>
> As you can see in the attached example, if I define a statement like: _select * from MyEvent where key = ?_ for which MyEvent.Key returns an interface, since the parameter given to the prepared statement is obviously a concrete object of this type, I hit a statement compilation error:
> Exception in thread "main" com.espertech.esper.client.EPStatementException: Unexpected error compiling statement: java.lang.IllegalStateException:Coercion type class java.lang.Object not numeric [select * from EsperTestObject$MyEvent where (key = EsperTestObject$MyObjectKey@1df5a8f)]
> at com.espertech.esper.core.StatementLifecycleSvcImpl.compile(StatementLifecycleSvcImpl.java:841)
> at com.espertech.esper.core.StatementLifecycleSvcImpl.createStopped(StatementLifecycleSvcImpl.java:180)
> at com.espertech.esper.core.StatementLifecycleSvcImpl.createAndStart(StatementLifecycleSvcImpl.java:153)
> at com.espertech.esper.core.StatementLifecycleSvcImpl.createAndStart(StatementLifecycleSvcImpl.java:113)
> at com.espertech.esper.core.EPAdministratorImpl.create(EPAdministratorImpl.java:226)
> at com.espertech.esper.core.EPAdministratorImpl.create(EPAdministratorImpl.java:231)
> at EsperTestObject.start(EsperTestObject.java:18)
> at EsperTestObject.main(EsperTestObject.java:56)
> I know this has already been discussed in ESPER-114, but I find really counter intuitive that you can only compare object of the exact same type. IMHO, if object comparison is supported in the statement, it should not narrow the normal behavior of java.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Updated: (ESPER-405) Equals operator on object types in expressions should support inheritance

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ http://jira.codehaus.org/browse/ESPER-405?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Frederic updated ESPER-405:
---------------------------

    Attachment: EsperTestConcreteObject.java

> Equals operator on object types in expressions should support inheritance
> -------------------------------------------------------------------------
>
>                 Key: ESPER-405
>                 URL: http://jira.codehaus.org/browse/ESPER-405
>             Project: Esper
>          Issue Type: Wish
>          Components: Core
>    Affects Versions: 3.2
>         Environment: winxp jdk6 esper-3.2
>            Reporter: Frederic
>         Attachments: EsperTestConcreteObject.java, EsperTestObject.java
>
>
> As you can see in the attached example, if I define a statement like: _select * from MyEvent where key = ?_ for which MyEvent.Key returns an interface, since the parameter given to the prepared statement is obviously a concrete object of this type, I hit a statement compilation error:
> Exception in thread "main" com.espertech.esper.client.EPStatementException: Unexpected error compiling statement: java.lang.IllegalStateException:Coercion type class java.lang.Object not numeric [select * from EsperTestObject$MyEvent where (key = EsperTestObject$MyObjectKey@1df5a8f)]
> at com.espertech.esper.core.StatementLifecycleSvcImpl.compile(StatementLifecycleSvcImpl.java:841)
> at com.espertech.esper.core.StatementLifecycleSvcImpl.createStopped(StatementLifecycleSvcImpl.java:180)
> at com.espertech.esper.core.StatementLifecycleSvcImpl.createAndStart(StatementLifecycleSvcImpl.java:153)
> at com.espertech.esper.core.StatementLifecycleSvcImpl.createAndStart(StatementLifecycleSvcImpl.java:113)
> at com.espertech.esper.core.EPAdministratorImpl.create(EPAdministratorImpl.java:226)
> at com.espertech.esper.core.EPAdministratorImpl.create(EPAdministratorImpl.java:231)
> at EsperTestObject.start(EsperTestObject.java:18)
> at EsperTestObject.main(EsperTestObject.java:56)
> I know this has already been discussed in ESPER-114, but I find really counter intuitive that you can only compare object of the exact same type. IMHO, if object comparison is supported in the statement, it should not narrow the normal behavior of java.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Commented: (ESPER-405) Equals operator on object types in expressions should support inheritance

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ http://jira.codehaus.org/browse/ESPER-405?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=194388#action_194388 ]

Thomas Bernhardt commented on ESPER-405:
----------------------------------------

In Java, one can perform "string.equals(integer)" without any type safety so since Esper provides full type safety the straight equals is not an option.

What we can do is enhance the engine to look at user objects and determine if there is an "extends" or "implements" relationship and in such case allow "equals" to take place.

Scheduled for 4.0 release.


> Equals operator on object types in expressions should support inheritance
> -------------------------------------------------------------------------
>
>                 Key: ESPER-405
>                 URL: http://jira.codehaus.org/browse/ESPER-405
>             Project: Esper
>          Issue Type: Wish
>          Components: Core
>    Affects Versions: 3.2
>         Environment: winxp jdk6 esper-3.2
>            Reporter: Frederic
>             Fix For: 4.0 - requires JDK6
>
>         Attachments: EsperTestConcreteObject.java, EsperTestObject.java
>
>
> As you can see in the attached example, if I define a statement like: _select * from MyEvent where key = ?_ for which MyEvent.Key returns an interface, since the parameter given to the prepared statement is obviously a concrete object of this type, I hit a statement compilation error:
> Exception in thread "main" com.espertech.esper.client.EPStatementException: Unexpected error compiling statement: java.lang.IllegalStateException:Coercion type class java.lang.Object not numeric [select * from EsperTestObject$MyEvent where (key = EsperTestObject$MyObjectKey@1df5a8f)]
> at com.espertech.esper.core.StatementLifecycleSvcImpl.compile(StatementLifecycleSvcImpl.java:841)
> at com.espertech.esper.core.StatementLifecycleSvcImpl.createStopped(StatementLifecycleSvcImpl.java:180)
> at com.espertech.esper.core.StatementLifecycleSvcImpl.createAndStart(StatementLifecycleSvcImpl.java:153)
> at com.espertech.esper.core.StatementLifecycleSvcImpl.createAndStart(StatementLifecycleSvcImpl.java:113)
> at com.espertech.esper.core.EPAdministratorImpl.create(EPAdministratorImpl.java:226)
> at com.espertech.esper.core.EPAdministratorImpl.create(EPAdministratorImpl.java:231)
> at EsperTestObject.start(EsperTestObject.java:18)
> at EsperTestObject.main(EsperTestObject.java:56)
> I know this has already been discussed in ESPER-114, but I find really counter intuitive that you can only compare object of the exact same type. IMHO, if object comparison is supported in the statement, it should not narrow the normal behavior of java.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Updated: (ESPER-405) Equals operator on object types in expressions should support inheritance

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ http://jira.codehaus.org/browse/ESPER-405?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Bernhardt updated ESPER-405:
-----------------------------------

         Priority: Minor  (was: Major)
    Fix Version/s: 4.0 - requires JDK6

> Equals operator on object types in expressions should support inheritance
> -------------------------------------------------------------------------
>
>                 Key: ESPER-405
>                 URL: http://jira.codehaus.org/browse/ESPER-405
>             Project: Esper
>          Issue Type: Wish
>          Components: Core
>    Affects Versions: 3.2
>         Environment: winxp jdk6 esper-3.2
>            Reporter: Frederic
>            Priority: Minor
>             Fix For: 4.0 - requires JDK6
>
>         Attachments: EsperTestConcreteObject.java, EsperTestObject.java
>
>
> As you can see in the attached example, if I define a statement like: _select * from MyEvent where key = ?_ for which MyEvent.Key returns an interface, since the parameter given to the prepared statement is obviously a concrete object of this type, I hit a statement compilation error:
> Exception in thread "main" com.espertech.esper.client.EPStatementException: Unexpected error compiling statement: java.lang.IllegalStateException:Coercion type class java.lang.Object not numeric [select * from EsperTestObject$MyEvent where (key = EsperTestObject$MyObjectKey@1df5a8f)]
> at com.espertech.esper.core.StatementLifecycleSvcImpl.compile(StatementLifecycleSvcImpl.java:841)
> at com.espertech.esper.core.StatementLifecycleSvcImpl.createStopped(StatementLifecycleSvcImpl.java:180)
> at com.espertech.esper.core.StatementLifecycleSvcImpl.createAndStart(StatementLifecycleSvcImpl.java:153)
> at com.espertech.esper.core.StatementLifecycleSvcImpl.createAndStart(StatementLifecycleSvcImpl.java:113)
> at com.espertech.esper.core.EPAdministratorImpl.create(EPAdministratorImpl.java:226)
> at com.espertech.esper.core.EPAdministratorImpl.create(EPAdministratorImpl.java:231)
> at EsperTestObject.start(EsperTestObject.java:18)
> at EsperTestObject.main(EsperTestObject.java:56)
> I know this has already been discussed in ESPER-114, but I find really counter intuitive that you can only compare object of the exact same type. IMHO, if object comparison is supported in the statement, it should not narrow the normal behavior of java.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Commented: (ESPER-405) Equals operator on object types in expressions should support inheritance

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ http://jira.codehaus.org/browse/ESPER-405?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=194560#action_194560 ]

Frederic commented on ESPER-405:
--------------------------------

Thanks, that would already be much more coherent with what we are used to see in java.

I see that you plan to fix this in version 4 of Esper, do you have any timeline for this release? Is there a possible patch in the meantime.

> Equals operator on object types in expressions should support inheritance
> -------------------------------------------------------------------------
>
>                 Key: ESPER-405
>                 URL: http://jira.codehaus.org/browse/ESPER-405
>             Project: Esper
>          Issue Type: Wish
>          Components: Core
>    Affects Versions: 3.2
>         Environment: winxp jdk6 esper-3.2
>            Reporter: Frederic
>            Priority: Minor
>             Fix For: 4.0 - requires JDK6
>
>         Attachments: EsperTestConcreteObject.java, EsperTestObject.java
>
>
> As you can see in the attached example, if I define a statement like: _select * from MyEvent where key = ?_ for which MyEvent.Key returns an interface, since the parameter given to the prepared statement is obviously a concrete object of this type, I hit a statement compilation error:
> Exception in thread "main" com.espertech.esper.client.EPStatementException: Unexpected error compiling statement: java.lang.IllegalStateException:Coercion type class java.lang.Object not numeric [select * from EsperTestObject$MyEvent where (key = EsperTestObject$MyObjectKey@1df5a8f)]
> at com.espertech.esper.core.StatementLifecycleSvcImpl.compile(StatementLifecycleSvcImpl.java:841)
> at com.espertech.esper.core.StatementLifecycleSvcImpl.createStopped(StatementLifecycleSvcImpl.java:180)
> at com.espertech.esper.core.StatementLifecycleSvcImpl.createAndStart(StatementLifecycleSvcImpl.java:153)
> at com.espertech.esper.core.StatementLifecycleSvcImpl.createAndStart(StatementLifecycleSvcImpl.java:113)
> at com.espertech.esper.core.EPAdministratorImpl.create(EPAdministratorImpl.java:226)
> at com.espertech.esper.core.EPAdministratorImpl.create(EPAdministratorImpl.java:231)
> at EsperTestObject.start(EsperTestObject.java:18)
> at EsperTestObject.main(EsperTestObject.java:56)
> I know this has already been discussed in ESPER-114, but I find really counter intuitive that you can only compare object of the exact same type. IMHO, if object comparison is supported in the statement, it should not narrow the normal behavior of java.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Commented: (ESPER-405) Equals operator on object types in expressions should support inheritance

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ http://jira.codehaus.org/browse/ESPER-405?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=194561#action_194561 ]

Frederic commented on ESPER-405:
--------------------------------

Just for tracking sake, I have add a comment in ESPER-404 which relates on this ticket.

> Equals operator on object types in expressions should support inheritance
> -------------------------------------------------------------------------
>
>                 Key: ESPER-405
>                 URL: http://jira.codehaus.org/browse/ESPER-405
>             Project: Esper
>          Issue Type: Wish
>          Components: Core
>    Affects Versions: 3.2
>         Environment: winxp jdk6 esper-3.2
>            Reporter: Frederic
>            Priority: Minor
>             Fix For: 4.0 - requires JDK6
>
>         Attachments: EsperTestConcreteObject.java, EsperTestObject.java
>
>
> As you can see in the attached example, if I define a statement like: _select * from MyEvent where key = ?_ for which MyEvent.Key returns an interface, since the parameter given to the prepared statement is obviously a concrete object of this type, I hit a statement compilation error:
> Exception in thread "main" com.espertech.esper.client.EPStatementException: Unexpected error compiling statement: java.lang.IllegalStateException:Coercion type class java.lang.Object not numeric [select * from EsperTestObject$MyEvent where (key = EsperTestObject$MyObjectKey@1df5a8f)]
> at com.espertech.esper.core.StatementLifecycleSvcImpl.compile(StatementLifecycleSvcImpl.java:841)
> at com.espertech.esper.core.StatementLifecycleSvcImpl.createStopped(StatementLifecycleSvcImpl.java:180)
> at com.espertech.esper.core.StatementLifecycleSvcImpl.createAndStart(StatementLifecycleSvcImpl.java:153)
> at com.espertech.esper.core.StatementLifecycleSvcImpl.createAndStart(StatementLifecycleSvcImpl.java:113)
> at com.espertech.esper.core.EPAdministratorImpl.create(EPAdministratorImpl.java:226)
> at com.espertech.esper.core.EPAdministratorImpl.create(EPAdministratorImpl.java:231)
> at EsperTestObject.start(EsperTestObject.java:18)
> at EsperTestObject.main(EsperTestObject.java:56)
> I know this has already been discussed in ESPER-114, but I find really counter intuitive that you can only compare object of the exact same type. IMHO, if object comparison is supported in the statement, it should not narrow the normal behavior of java.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Updated: (ESPER-405) Equals operator on object types in expressions should support inheritance

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ http://jira.codehaus.org/browse/ESPER-405?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Frederic Tardif updated ESPER-405:
----------------------------------

    Attachment: esper-405-patch.txt

Patch enabling = operator in statements on objects using inheritance

> Equals operator on object types in expressions should support inheritance
> -------------------------------------------------------------------------
>
>                 Key: ESPER-405
>                 URL: http://jira.codehaus.org/browse/ESPER-405
>             Project: Esper
>          Issue Type: Wish
>          Components: Core
>    Affects Versions: 3.2
>         Environment: winxp jdk6 esper-3.2
>            Reporter: Frederic Tardif
>            Priority: Minor
>             Fix For: 4.0 - requires JDK6
>
>         Attachments: esper-405-patch.txt, EsperTestConcreteObject.java, EsperTestObject.java
>
>
> As you can see in the attached example, if I define a statement like: _select * from MyEvent where key = ?_ for which MyEvent.Key returns an interface, since the parameter given to the prepared statement is obviously a concrete object of this type, I hit a statement compilation error:
> Exception in thread "main" com.espertech.esper.client.EPStatementException: Unexpected error compiling statement: java.lang.IllegalStateException:Coercion type class java.lang.Object not numeric [select * from EsperTestObject$MyEvent where (key = EsperTestObject$MyObjectKey@1df5a8f)]
> at com.espertech.esper.core.StatementLifecycleSvcImpl.compile(StatementLifecycleSvcImpl.java:841)
> at com.espertech.esper.core.StatementLifecycleSvcImpl.createStopped(StatementLifecycleSvcImpl.java:180)
> at com.espertech.esper.core.StatementLifecycleSvcImpl.createAndStart(StatementLifecycleSvcImpl.java:153)
> at com.espertech.esper.core.StatementLifecycleSvcImpl.createAndStart(StatementLifecycleSvcImpl.java:113)
> at com.espertech.esper.core.EPAdministratorImpl.create(EPAdministratorImpl.java:226)
> at com.espertech.esper.core.EPAdministratorImpl.create(EPAdministratorImpl.java:231)
> at EsperTestObject.start(EsperTestObject.java:18)
> at EsperTestObject.main(EsperTestObject.java:56)
> I know this has already been discussed in ESPER-114, but I find really counter intuitive that you can only compare object of the exact same type. IMHO, if object comparison is supported in the statement, it should not narrow the normal behavior of java.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Issue Comment Edited: (ESPER-405) Equals operator on object types in expressions should support inheritance

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ http://jira.codehaus.org/browse/ESPER-405?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=194893#action_194893 ]

Frederic Tardif edited comment on ESPER-405 at 10/15/09 1:02 PM:
-----------------------------------------------------------------

Patch attached to enable "= operator" in statements on objects using inheritance

      was (Author: frederic.tardif):
    Patch enabling = operator in statements on objects using inheritance
 

> Equals operator on object types in expressions should support inheritance
> -------------------------------------------------------------------------
>
>                 Key: ESPER-405
>                 URL: http://jira.codehaus.org/browse/ESPER-405
>             Project: Esper
>          Issue Type: Wish
>          Components: Core
>    Affects Versions: 3.2
>         Environment: winxp jdk6 esper-3.2
>            Reporter: Frederic Tardif
>            Priority: Minor
>             Fix For: 4.0 - requires JDK6
>
>         Attachments: esper-405-patch.txt, EsperTestConcreteObject.java, EsperTestObject.java
>
>
> As you can see in the attached example, if I define a statement like: _select * from MyEvent where key = ?_ for which MyEvent.Key returns an interface, since the parameter given to the prepared statement is obviously a concrete object of this type, I hit a statement compilation error:
> Exception in thread "main" com.espertech.esper.client.EPStatementException: Unexpected error compiling statement: java.lang.IllegalStateException:Coercion type class java.lang.Object not numeric [select * from EsperTestObject$MyEvent where (key = EsperTestObject$MyObjectKey@1df5a8f)]
> at com.espertech.esper.core.StatementLifecycleSvcImpl.compile(StatementLifecycleSvcImpl.java:841)
> at com.espertech.esper.core.StatementLifecycleSvcImpl.createStopped(StatementLifecycleSvcImpl.java:180)
> at com.espertech.esper.core.StatementLifecycleSvcImpl.createAndStart(StatementLifecycleSvcImpl.java:153)
> at com.espertech.esper.core.StatementLifecycleSvcImpl.createAndStart(StatementLifecycleSvcImpl.java:113)
> at com.espertech.esper.core.EPAdministratorImpl.create(EPAdministratorImpl.java:226)
> at com.espertech.esper.core.EPAdministratorImpl.create(EPAdministratorImpl.java:231)
> at EsperTestObject.start(EsperTestObject.java:18)
> at EsperTestObject.main(EsperTestObject.java:56)
> I know this has already been discussed in ESPER-114, but I find really counter intuitive that you can only compare object of the exact same type. IMHO, if object comparison is supported in the statement, it should not narrow the normal behavior of java.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Resolved: (ESPER-405) Equals operator on object types in expressions should support inheritance

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ http://jira.codehaus.org/browse/ESPER-405?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Bernhardt resolved ESPER-405.
------------------------------------

       Resolution: Fixed
    Fix Version/s:     (was: 4.0 - requires JDK6)
                   3.3

Assigned to release 3.3, in enh3.3 branch

> Equals operator on object types in expressions should support inheritance
> -------------------------------------------------------------------------
>
>                 Key: ESPER-405
>                 URL: http://jira.codehaus.org/browse/ESPER-405
>             Project: Esper
>          Issue Type: Wish
>          Components: Core
>    Affects Versions: 3.2
>         Environment: winxp jdk6 esper-3.2
>            Reporter: Frederic Tardif
>            Priority: Minor
>             Fix For: 3.3
>
>         Attachments: esper-405-patch.txt, EsperTestConcreteObject.java, EsperTestObject.java
>
>
> As you can see in the attached example, if I define a statement like: _select * from MyEvent where key = ?_ for which MyEvent.Key returns an interface, since the parameter given to the prepared statement is obviously a concrete object of this type, I hit a statement compilation error:
> Exception in thread "main" com.espertech.esper.client.EPStatementException: Unexpected error compiling statement: java.lang.IllegalStateException:Coercion type class java.lang.Object not numeric [select * from EsperTestObject$MyEvent where (key = EsperTestObject$MyObjectKey@1df5a8f)]
> at com.espertech.esper.core.StatementLifecycleSvcImpl.compile(StatementLifecycleSvcImpl.java:841)
> at com.espertech.esper.core.StatementLifecycleSvcImpl.createStopped(StatementLifecycleSvcImpl.java:180)
> at com.espertech.esper.core.StatementLifecycleSvcImpl.createAndStart(StatementLifecycleSvcImpl.java:153)
> at com.espertech.esper.core.StatementLifecycleSvcImpl.createAndStart(StatementLifecycleSvcImpl.java:113)
> at com.espertech.esper.core.EPAdministratorImpl.create(EPAdministratorImpl.java:226)
> at com.espertech.esper.core.EPAdministratorImpl.create(EPAdministratorImpl.java:231)
> at EsperTestObject.start(EsperTestObject.java:18)
> at EsperTestObject.main(EsperTestObject.java:56)
> I know this has already been discussed in ESPER-114, but I find really counter intuitive that you can only compare object of the exact same type. IMHO, if object comparison is supported in the statement, it should not narrow the normal behavior of java.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email