Hello Trygve 2014-04-22 20:11 GMT+02:00 Trygve Laugstøl <[email protected]>:
> Hi > > I was wondering if it is possible to select tables and columns in an > easier way than a single regex as described in [1]. > > We have over 150 tables in our schema, and I'd like to select a small > subset of the tables and subset of the columns in the selected tables. > Right now my <includes> line in the pom.xml is 430 characters long and very > hard to maintain. The reason for selecting the columns too is that some of > our tables have many columns and we're expecting non-relevant columns to > change a lot and when JOOQ does selects it touches all the columns. I > really like the record way of doing it so I'd rather just limit the number > of columns available in the record. > > So the question is if there is a better way to write the "includes" regex, > like for example: > > <includePatterns> > <include>my_table.*</include> > <include>my_other_table.(id|from|to)</include> > </includePatterns> > Yes, something like this was requested before. I cannot seem to find the relevant thread in the user group, though. Essentially, these "multi-include" elements are just the same as a more sophisticated regex (don't forget to escape periods. Just in case): my_table\.*|my_other_table\.(id|from|to) I wonder if we should allow for ignoring whitespace and allowing comments in regexes using http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html#COMMENTS my_table\.* (?# This is a comment) | my_other_table\.(id|from|to) (?# This is another comment) > As far as I understand the current implementation, it throws all table and > column names (if includeExcludeColumns is set) in a single big list and > picks out all objects that the regex matches. This might lead to failures > for me as I can't pick out a column called "from" in one table, but skip > the "from" field in another table. It's either both or none from what I can > tell. > Hmm, by fully qualifying things, you should be able to include "from" only in one table? Cheers Lukas -- You received this message because you are subscribed to the Google Groups "jOOQ User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
