[
https://issues.apache.org/jira/browse/EMPIREDB-484?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18056030#comment-18056030
]
Ralf Eichinger commented on EMPIREDB-484:
-----------------------------------------
Rainer:
Being able to filter tables for CodeGen sounds like a good idea.
But then it should also be possible to exclude certain views.
Generally you should always create a JiraTicket for such issues, so that we can
track them.
In your commit comment you should then always specify the JIRA ticket number
e.g. "EMPIREDB-484"
IMO first two properties are required in CodeGenConfig.java.
To be consistent with the other properties, I would recommend to name them
- tableExcludePattern
- viewExcludePattern
To my surprise I have found that there already is a property called
"dbTablePattern". But it does not seem to be used anywhere.
Hence I would recommend removing this property.
> CodeGen: exclude-Pattern for tables and views
> ---------------------------------------------
>
> Key: EMPIREDB-484
> URL: https://issues.apache.org/jira/browse/EMPIREDB-484
> Project: Empire-DB
> Issue Type: New Feature
> Components: CodeGenerator
> Affects Versions: empire-db-3.4.0
> Reporter: Ralf Eichinger
> Priority: Minor
> Fix For: empire-db-3.4.1
>
>
> I am using maven plugin to generate code from existing database.
> there are tables from thirdparty software (flowable) starting with "ACT_"
> and "FLW_".
> I want to exclude them from generation.
> Currently this is not possible.
> But I think it would be easy to add a regex matching for configured exclusion
> pattern in CodeGenWriter.generateCodeFiles:
> // Create table classes, record interfaces and record classes for (DBTable
> table :
> {code:java}
> db.getTables()) {
> if (table.getName().matches(config.getDbTablesExclusionPattern()) {
> continue; // skip the excluded table
> }
> if (!config.isNestTables()) {
> // if table nesting is disabled, create separate table classes
> generatedFiles.add(this.createTableClass(db, table));
> }
> if (config.isGenerateRecords()) {
> // generate record
> generatedFiles.add(this.createRecordClass(db, table));
> }
> }{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)