How to get rid of files with bin $ names

Using the Jooq generator, the Gradle plugin, I now get with POJO and tables not only classes with normal names, but also heaps of files whose names begin with bin $.

They are not needed, because only yesterday the generator did not make these files. And everything works fine with or without them. But I do not want the project to be littered with dozens of redundant files.

+7
java oracle code-generation gradle jooq
source share
2 answers

jOOQ <excludes/> is a Java regular expression. You must correctly form it as follows:

 excludes = '(?i:BIN\\$.*)' 

Explanation:

  • Use (?i:...) for case insensitivity. Just in case. Pun intended.
  • Use \\ before the $ sign, because $ means "end of line" in regular expressions. You want to avoid this. And since Groovy / Gradle parses (like in “look for escape sequences”) your string, you also need to avoid the backslash in order to reach Java Pattern.compile() call
  • Use .* To indicate that after $ you want to match any number of characters. . = any character and * = any number of repetitions
+4
source share

Starting with version 10, Oracle places dropped tables in the trash. They have names starting with Bin $. That way, JooQ just creates classes for dropped tables. This can be blocked in two ways: stop using bean utilization in Oracle or filter the tables for which the Jooq generator creates classes.

 ALTER SYSTEM SET RECYCLEBIN = OFF DEFERRED; purge dba_recyclebin; 

or change the generator setting (example for Gradle)

 generator{ ... database { ... excludes = '(?i:BIN\\$.*)' 

Edit: Finally, after several attempts (by Lucas) and checks (by me), Lucas found the right meaning for excludes . Its form, IMHO, has a single explanation: JOOQ does not work with regular expressions correctly, for Groovy it does not parse strings in single quotes.

+6
source share

All Articles