Hi Thomas again.

please do not waste your time on this. I've seen that H2 ask for the data 
rightly, It asks for John and later for Peter data. The problem was that my 
plugged table is a wrapper of an underlying FunctionAlias and I took a the 
code code of few classes for that  and therefore I inherited some undesired 
behaviors from the org.h2.index.FunctionIndex among other classes which I 
modified:


 public Cursor find(Session session, SearchRow first, SearchRow last) {
        if (functionTable.isBufferResultSetToLocalTemp()) {
            return new FunctionCursor(functionTable.getResult(session));
        }
        return new FunctionCursorResultSet(session,
                functionTable.getResultSet(session));
    }

The method above does not pass forward the SearchRow parameters to the 
functionTable (only the session is forwarded), so such information was lost 
from the functionTable (which I modified too). This is the reason because I 
needed to access to the select object conditions. I realized now that it 
was totally unnecessary furthermore stupid because parsing a query from 
inside a parsed query had not too much sense and it also was pretty 
difficult to make it work rightly (it was like replacing and existing wheel 
by a square).

Thanks,
Pablo.
 

On Saturday, April 11, 2015 at 5:08:19 PM UTC+2, Pablo Beltran wrote:
>
> Hi,
>
> Given a SQL quer... how to get the where clause? 
>
> ...
> String sql = "select * from T where col1=value1 and col2=value2 or 
> col3=value3";
> Parser parser = new Parser(session);
> Select select = (Select) parser.prepare(sql);
>
> String where = ...
>
> //How to get the where clause? "col1=value1 and col2=value2 or col3=value3"
>
> Thanks!
> Pablo.
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to