Search code examples
javaesper

EPL Esper select from java Set


I am writing select query for EPL Esper, and I need to add where clause based on info from object which stores in java set.

myCalss2{
    int prop1;
    String prop2;
}
    
class myClass{
    int someFiled;
    boolean foo;
    Set<myClass2> bar;
}

I need to compare value of prop2, but I get instance of myClass, how to get value of prop2?


Solution

  • So "myClass" really has multiple "prop2" values.

    Esper provides enumeration methods (aka. lambda funcs) so something like this would work: "bar.anyOf(v => v.prop2 = 'some value')"

    See http://esper.codehaus.org/esper-4.10.0/doc/reference/en-US/html_single/index.html#enumerationreference

    Sample in a EPL: "select * from MyClass(bar.anyOf(v => v.prop2 = 'some value'))"