| 1 |
|
package org.apache.torque.mojo; |
| 2 |
|
|
| 3 |
|
import java.io.IOException; |
| 4 |
|
import java.util.Properties; |
| 5 |
|
|
| 6 |
|
import org.apache.maven.plugin.MojoExecutionException; |
| 7 |
|
import org.kuali.db.jdbc.DatabaseCommand; |
| 8 |
|
import org.kuali.db.jdbc.SQLGenerator; |
| 9 |
|
import org.kuali.db.jdbc.Transaction; |
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
|
|
|
| 0% |
Uncovered Elements: 11 (11) |
Complexity: 2 |
Complexity Density: 0.2 |
|
| 14 |
|
public abstract class SingleDBACommandMojo extends AbstractDBACommandMojo { |
| 15 |
|
|
| 16 |
|
public abstract String getCommand(); |
| 17 |
|
|
|
|
|
| 0% |
Uncovered Elements: 10 (10) |
Complexity: 2 |
Complexity Density: 0.2 |
|
| 18 |
0
|
@Override... |
| 19 |
|
protected void configureTransactions() throws MojoExecutionException { |
| 20 |
0
|
Properties properties = getContextProperties(); |
| 21 |
0
|
SQLGenerator generator = new SQLGenerator(properties, url, DatabaseCommand.valueOf(getCommand().toUpperCase())); |
| 22 |
0
|
try { |
| 23 |
0
|
generator.setEncoding(getEncoding()); |
| 24 |
0
|
String sql = generator.getSQL(); |
| 25 |
0
|
Transaction t = new Transaction(); |
| 26 |
0
|
t.addText(sql); |
| 27 |
0
|
t.setDescription(getTransactionDescription(DatabaseCommand.valueOf(getCommand().toUpperCase()))); |
| 28 |
0
|
transactions.add(t); |
| 29 |
|
} catch (IOException e) { |
| 30 |
0
|
throw new MojoExecutionException("Error configuring transactions", e); |
| 31 |
|
} |
| 32 |
|
} |
| 33 |
|
} |