Package ch.inftec.ju.util

Examples of ch.inftec.ju.util.XString


    }
  }
 
  @Override
  public void execute() {
    XString deleteQry = null;
    try {
      deleteQry = new XString("DELETE FROM " + this.getTableName() + " WHERE " + this.getPrimaryKeyValue().getColumnName() + "=?");

      int res = this.getDbConnection().getQueryRunner().update(deleteQry.toString(), this.getPrimaryKeyValue().getOriginalValue());
      if (res != 1) throw new JuDbException("Execution of query returned " + res + ", expected 1: " + deleteQry);
    } catch (Exception ex) {
      throw new JuRuntimeException("Failed to execute delete: " + deleteQry, ex);
    }
  }
View Full Code Here


    super(dbConn, row, tableName);
  }
 
  @Override
  public void execute() {
    XString insertQry = null;
    try {
      insertQry = new XString("INSERT INTO " + this.getTableName() + " (");
     
      ArrayList<Object> values = new ArrayList<Object>();
      XString valuesQry = new XString("VALUES (");
      for (int i = 0; i < this.getRow().getColumnCount(); i++) {
        String columnName = this.getRow().getColumnName(i);
        insertQry.assertText("(", ", ");
        insertQry.addText(columnName);
        valuesQry.assertText("(", ", ");
        valuesQry.addText("?");
        values.add(this.getVal(columnName).getValue());
      }
      insertQry.addText(") ");
      insertQry.addText(valuesQry);
      insertQry.addText(")");
View Full Code Here

   
    public JuEmfUtil build() {
      AssertUtil.assertNotEmpty("PersistenceUnit name must be specified", this.persistenceUnitName);
     
      // Build a unique identifier String to see if we already have this EmfUtil available.
      XString xs = new XString();
      xs.addItems("|", this.persistenceUnitName, this.connectionUrl);
     
      if (!JuEmfUtilBuilder.emfUtils.containsKey(xs)) {
        // Create a new EmfUtil
       
        String dialect = null;
View Full Code Here

TOP

Related Classes of ch.inftec.ju.util.XString

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.