Examples of ArgumentHolder


Examples of com.j256.ormlite.stmt.ArgumentHolder

    boolean appendSpace = true;
    if (argOrValue == null) {
      throw new SQLException("argument to comparison of '" + fieldType.getFieldName() + "' is null");
    } else if (argOrValue instanceof ArgumentHolder) {
      sb.append('?');
      ArgumentHolder selectArg = (ArgumentHolder) argOrValue;
      selectArg.setMetaInfo(columnName, fieldType);
      argList.add(selectArg);
    } else if (fieldType.isSelectArgRequired()) {
      sb.append('?');
      ArgumentHolder selectArg = new SelectArg();
      selectArg.setMetaInfo(columnName, fieldType);
      // conversion is done when the getValue() is called
      selectArg.setValue(argOrValue);
      argList.add(selectArg);
    } else if (fieldType.isForeign() && fieldType.getFieldType() == argOrValue.getClass()) {
      /*
       * If we have a foreign field and our argument is an instance of the foreign object (i.e. not its id), then
       * we need to extract the id.
View Full Code Here

Examples of com.j256.ormlite.stmt.ArgumentHolder

    boolean appendSpace = true;
    if (argOrValue == null) {
      throw new SQLException("argument for '" + fieldType.getFieldName() + "' is null");
    } else if (argOrValue instanceof ArgumentHolder) {
      sb.append('?');
      ArgumentHolder argHolder = (ArgumentHolder) argOrValue;
      argHolder.setMetaInfo(columnName, fieldType);
      argList.add(argHolder);
    } else if (argOrValue instanceof ColumnArg) {
      ColumnArg columnArg = (ColumnArg) argOrValue;
      String tableName = columnArg.getTableName();
      if (tableName != null) {
        databaseType.appendEscapedEntityName(sb, tableName);
        sb.append('.');
      }
      databaseType.appendEscapedEntityName(sb, columnArg.getColumnName());
    } else if (fieldType.isArgumentHolderRequired()) {
      sb.append('?');
      ArgumentHolder argHolder = new SelectArg();
      argHolder.setMetaInfo(columnName, fieldType);
      // conversion is done when the getValue() is called
      argHolder.setValue(argOrValue);
      argList.add(argHolder);
    } else if (fieldType.isForeign() && fieldType.getType().isAssignableFrom(argOrValue.getClass())) {
      /*
       * If we have a foreign field and our argument is an instance of the foreign object (i.e. not its id), then
       * we need to extract the id. We allow super-classes of the field but not sub-classes.
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.