1 package org.apache.torque.mojo;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.io.File;
23
24 import org.apache.commons.configuration.PropertiesConfiguration;
25 import org.apache.maven.plugin.MojoExecutionException;
26 import org.apache.tools.ant.types.FileSet;
27 import org.kuali.core.db.torque.KualiTorqueSQLTask;
28
29
30
31
32 public abstract class SqlMojoBase extends DataModelTaskMojo {
33
34
35
36
37 public SqlMojoBase() {
38 setAntTask(new KualiTorqueSQLTask());
39 }
40
41
42
43
44
45
46 protected PropertiesConfiguration getMojoContextProperties() {
47 PropertiesConfiguration configuration = new PropertiesConfiguration();
48 configuration.addProperty(TARGET_DATABASE_CONTEXT_PROPERTY, super.getTargetDatabase());
49 return configuration;
50 }
51
52
53
54
55
56
57 protected String getControlTemplate() {
58 return "sql/base/Control.vm";
59 }
60
61
62
63
64 protected void configureTask() throws MojoExecutionException {
65 super.configureTask();
66
67 KualiTorqueSQLTask task = (KualiTorqueSQLTask) super.getGeneratorTask();
68
69 if (getSuffix() != null) {
70 getLog().debug("Adding suffix: " + getSuffix());
71 task.setSuffix(getSuffix());
72 }
73 FileSet fileSet = getAntFileSet(new File(getSchemaDir()), getSchemaIncludes(), getSchemaExcludes());
74 task.addFileset(fileSet);
75 }
76
77 }