Hi Thomas - I'm querying a proprietary database which stores its data in an object-tree (fields and collections make up its content). There's no way to "query" this data structure other than use the Java APIs that come with the database (the best way to explain the database is a "content management system" type repository).
My intention is to use H2 as a JDBC driver and NOT a database. The database is the repository I just mentioned, I just want to pass-thru the results from repository->H2 driver -> client. This is why I'm building transient tables via TableEngine and creating/disposing results immediately (I could cache later on, but that complexity is not something I need to address right now). The alternative is to implement the JDBC specification for my purpose but H2 already accomplishes this so well. Let me know if this makes sense - Atul On Mon, Aug 6, 2012 at 2:42 AM, Thomas Mueller <[email protected] > wrote: > Hi, > > Could you tell me what problem you want to solve on a higher level? Why do > you need to have access to the parse tree? I think you depend too much > about implementation details of H2. > > Regards, > Thomas > > > > On Monday, July 30, 2012, Atul wrote: > >> Also, what I'm really saying is: >> >> Is there a way to access *org.h2.command.dml.Select* from my >> TableEngine implementation through some field/superclass method/ >> property of the RegularTable that I extend? Perhaps through "session" >> or something else? >> >> On Jul 29, 10:07 pm, Atul <[email protected]> wrote: >> > Hi - >> > >> > In order to pre-filter my custom Table ( using "MyTableEngine" and >> > "MyTable <extends RegularTable> " ), I need to: >> > >> > a) determine what the components of the SQL select being fired by the >> > client are (including select expressions, condition expressions) >> > b) parse this SQL >> > c) pre-filter my list of java objects >> > d) add the now-filtered object rows to my custom table's ScanIndex >> > >> > Currently I can do this without any problem by hooking into: >> > >> > protected LocalResult queryWithoutCache(int maxRows, ResultTarget >> > target) >> > >> > Inside this, I perform a call to getTables() and retrieve any >> > TableFilter that's an instanceof MyTable. When it is, I call to a >> > utility class method "MyTablePreparer(Expression[] conditions, >> > Expression[] selectExpressions, Set<Column> columns, TableFilter >> > tableFilter)" >> > >> > ...where I read through the select columns and ultimately build by own >> > Rows (i.e. Value [] data ) using something like: >> > MyTable.getScanIndex(session).add(session, row); >> > >> > However, I'd like to understand if, within the query lifecycle, I can >> > utilize any overridable/implementable methods in MyTable (which >> > extends RegularTable) which allow me to NOT have to use >> > Select.queryWithoutCache(int maxRows, ResultTarget target) to perform >> > these same activities. >> > >> > The closest thing I've found is a fire-before-select but even here I'm >> > unable to get a handle on the running query (I tried >> > session.getCurrentCommand() but it's mostly empty at the times where >> > it's of any use to me inside my RegularTable). >> > >> > It's really only three lines of code to the H2 codebase that I've >> > added for the time being that I'd like to get rid of completely in >> > order to not have to modify any part of H2. >> > >> > Thanks for any help in advance ! >> >> -- >> You received this message because you are subscribed to the Google Groups >> "H2 Database" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]. >> For more options, visit this group at >> http://groups.google.com/group/h2-database?hl=en. >> >> -- > You received this message because you are subscribed to the Google Groups > "H2 Database" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/h2-database?hl=en. > -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.
