| 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 | 
    
            
    
     | 
    
           | 
  
            
  
    | 14 | 
    
            
    
     | 
    
           | 
  
            
  
    | 15 | 
    
            
    
     | 
    
           | 
  
            
  
    | 16 | 
    
            
    
     | 
    
           | 
  
               
        | 
             
         | 
        
       
        | 
       
           
           
            | 0% | 
           Uncovered Elements: 14 (14) | 
           Complexity: 3 | 
           Complexity Density: 0.25 | 
                        
            
        | 
    
  
  
    | 17 | 
    
            
    
     | 
    
      public class ResetMojo extends AbstractDBACommandMojo {     | 
  
            
  
    | 18 | 
    
            
    
     | 
    
           | 
  
               
        | 
             
         | 
        
       
        | 
       
           
           
            | 0% | 
           Uncovered Elements: 7 (7) | 
           Complexity: 1 | 
           Complexity Density: 0.14 | 
                        
            
        | 
    
  
  
    | 19 | 
    
           0
    
     | 
    
           protected Transaction getTransaction(Properties properties, DatabaseCommand command) throws IOException {...     | 
  
            
  
    | 20 | 
    
           0
    
     | 
    
              SQLGenerator generator = new SQLGenerator(properties, url, command);     | 
  
            
  
    | 21 | 
    
           0
    
     | 
    
              generator.setEncoding(getEncoding());     | 
  
            
  
    | 22 | 
    
           0
    
     | 
    
              String sql = generator.getSQL();     | 
  
            
  
    | 23 | 
    
           0
    
     | 
    
              Transaction t = new Transaction();     | 
  
            
  
    | 24 | 
    
           0
    
     | 
    
              t.setDescription(getTransactionDescription(command));     | 
  
            
  
    | 25 | 
    
           0
    
     | 
    
              t.addText(sql);     | 
  
            
  
    | 26 | 
    
           0
    
     | 
    
              return t;     | 
  
            
  
    | 27 | 
    
            
    
     | 
    
          }     | 
  
            
  
    | 28 | 
    
            
    
     | 
    
           | 
  
               
        | 
             
         | 
        
       
        | 
       
           
           
            | 0% | 
           Uncovered Elements: 5 (5) | 
           Complexity: 2 | 
           Complexity Density: 0.4 | 
                        
            
        | 
    
  
  
    | 29 | 
    
           0
    
     | 
    
           @Override...     | 
  
            
  
    | 30 | 
    
            
    
     | 
    
          protected void configureTransactions() throws MojoExecutionException {     | 
  
            
  
    | 31 | 
    
           0
    
     | 
    
              Properties properties = getContextProperties();     | 
  
            
  
    | 32 | 
    
           0
    
     | 
    
              try {     | 
  
            
  
    | 33 | 
    
           0
    
     | 
    
                  transactions.add(getTransaction(properties, DatabaseCommand.DROP));     | 
  
            
  
    | 34 | 
    
           0
    
     | 
    
                  transactions.add(getTransaction(properties, DatabaseCommand.CREATE));     | 
  
            
  
    | 35 | 
    
            
    
     | 
    
              } catch (IOException e) {     | 
  
            
  
    | 36 | 
    
           0
    
     | 
    
                  throw new MojoExecutionException("Error generating SQL", e);     | 
  
            
  
    | 37 | 
    
            
    
     | 
    
              }     | 
  
            
  
    | 38 | 
    
            
    
     | 
    
          }     | 
  
            
  
    | 39 | 
    
            
    
     | 
    
      }     |