[#6951] Add <includeTriggerRoutines/> flag to exclude the generation of PostgreSQL trigger routines
This commit is contained in:
parent
6f85bc2208
commit
c19a66c871
@ -426,6 +426,7 @@ public class GenerationTool {
|
||||
database.setIncludeRoutines(!FALSE.equals(d.isIncludeRoutines()));
|
||||
database.setIncludeSequences(!FALSE.equals(d.isIncludeSequences()));
|
||||
database.setIncludeTables(!FALSE.equals(d.isIncludeTables()));
|
||||
database.setIncludeTriggerRoutines(TRUE.equals(d.isIncludeTriggerRoutines()));
|
||||
database.setIncludeUDTs(!FALSE.equals(d.isIncludeUDTs()));
|
||||
database.setIncludeUniqueKeys(!FALSE.equals(d.isIncludeUniqueKeys()));
|
||||
database.setRecordVersionFields(new String[] { defaultString(d.getRecordVersionFields()) });
|
||||
|
||||
@ -121,6 +121,7 @@ public abstract class AbstractDatabase implements Database {
|
||||
private boolean includeExcludeColumns;
|
||||
private boolean includeTables = true;
|
||||
private boolean includeRoutines = true;
|
||||
private boolean includeTriggerRoutines = false;
|
||||
private boolean includePackages = true;
|
||||
private boolean includeUDTs = true;
|
||||
private boolean includeSequences = true;
|
||||
@ -742,6 +743,16 @@ public abstract class AbstractDatabase implements Database {
|
||||
this.includeRoutines = includeRoutines;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIncludeTriggerRoutines(boolean includeTriggerRoutines) {
|
||||
this.includeTriggerRoutines = includeTriggerRoutines;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getIncludeTriggerRoutines() {
|
||||
return includeTriggerRoutines;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean getIncludePackages() {
|
||||
return includePackages;
|
||||
|
||||
@ -461,6 +461,16 @@ public interface Database {
|
||||
*/
|
||||
boolean getIncludeRoutines();
|
||||
|
||||
/**
|
||||
* whether trigger routines should be included.
|
||||
*/
|
||||
void setIncludeTriggerRoutines(boolean includeTriggerRoutines);
|
||||
|
||||
/**
|
||||
* whether trigger routines should be included.
|
||||
*/
|
||||
boolean getIncludeTriggerRoutines();
|
||||
|
||||
/**
|
||||
* Whether tables (and views) should be included.
|
||||
*/
|
||||
|
||||
@ -58,6 +58,8 @@ public class Database implements Serializable
|
||||
protected Boolean includeTables = true;
|
||||
@XmlElement(defaultValue = "true")
|
||||
protected Boolean includeRoutines = true;
|
||||
@XmlElement(defaultValue = "false")
|
||||
protected Boolean includeTriggerRoutines = false;
|
||||
@XmlElement(defaultValue = "true")
|
||||
protected Boolean includePackages = true;
|
||||
@XmlElement(defaultValue = "true")
|
||||
@ -365,6 +367,30 @@ public class Database implements Serializable
|
||||
this.includeRoutines = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* This flag indicates whether trigger implementation routines should be included in output produced by this database (e.g. in PostgreSQL)
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link Boolean }
|
||||
*
|
||||
*/
|
||||
public Boolean isIncludeTriggerRoutines() {
|
||||
return includeTriggerRoutines;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the includeTriggerRoutines property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link Boolean }
|
||||
*
|
||||
*/
|
||||
public void setIncludeTriggerRoutines(Boolean value) {
|
||||
this.includeTriggerRoutines = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* This flag indicates whether packages should be included in output produced by this database
|
||||
*
|
||||
@ -1172,6 +1198,11 @@ public class Database implements Serializable
|
||||
return this;
|
||||
}
|
||||
|
||||
public Database withIncludeTriggerRoutines(Boolean value) {
|
||||
setIncludeTriggerRoutines(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Database withIncludePackages(Boolean value) {
|
||||
setIncludePackages(value);
|
||||
return this;
|
||||
|
||||
@ -768,6 +768,9 @@ public class PostgresDatabase extends AbstractDatabase {
|
||||
.and(tableValuedFunctions()
|
||||
? condition(not(PG_PROC.PRORETSET))
|
||||
: noCondition())
|
||||
.and(!getIncludeTriggerRoutines()
|
||||
? r1.DATA_TYPE.ne(inline("trigger"))
|
||||
: noCondition())
|
||||
.orderBy(
|
||||
r1.ROUTINE_SCHEMA.asc(),
|
||||
r1.ROUTINE_NAME.asc(),
|
||||
|
||||
@ -444,6 +444,10 @@ Excludes match before includes, i.e. excludes have a higher priority.]]></jxb:ja
|
||||
<annotation><appinfo><jxb:property><jxb:javadoc><![CDATA[This flag indicates whether routines should be included in output produced by this database]]></jxb:javadoc></jxb:property></appinfo></annotation>
|
||||
</element>
|
||||
|
||||
<element name="includeTriggerRoutines" type="boolean" default="false" minOccurs="0" maxOccurs="1">
|
||||
<annotation><appinfo><jxb:property><jxb:javadoc><![CDATA[This flag indicates whether trigger implementation routines should be included in output produced by this database (e.g. in PostgreSQL)]]></jxb:javadoc></jxb:property></appinfo></annotation>
|
||||
</element>
|
||||
|
||||
<element name="includePackages" type="boolean" default="true" minOccurs="0" maxOccurs="1">
|
||||
<annotation><appinfo><jxb:property><jxb:javadoc><![CDATA[This flag indicates whether packages should be included in output produced by this database]]></jxb:javadoc></jxb:property></appinfo></annotation>
|
||||
</element>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user