Examples of extractJavaFieldValue()


Examples of com.j256.ormlite.field.FieldType.extractJavaFieldValue()

      return null;
    } else if (fieldType == null) {
      return value;
    } else if (fieldType.isForeign() && fieldType.getFieldType() == value.getClass()) {
      FieldType idFieldType = fieldType.getForeignIdField();
      return idFieldType.extractJavaFieldValue(value);
    } else {
      return fieldType.convertJavaFieldToSqlArgValue(value);
    }
  }
View Full Code Here

Examples of com.j256.ormlite.field.FieldType.extractJavaFieldValue()

  public ID extractId(T data) throws SQLException {
    checkForInitialized();
    FieldType idField = tableInfo.getIdField();
    @SuppressWarnings("unchecked")
    ID id = (ID) idField.extractJavaFieldValue(data);
    return id;
  }

  public Class<T> getDataClass() {
    return dataClass;
View Full Code Here

Examples of com.j256.ormlite.field.FieldType.extractJavaFieldValue()

      /*
       * 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.
       */
      FieldType idFieldType = fieldType.getForeignIdField();
      appendArgOrValue(databaseType, idFieldType, sb, argList, idFieldType.extractJavaFieldValue(argOrValue));
      // no need for the space since it was done in the recursion
      appendSpace = false;
    } else if (fieldType.isEscapedValue()) {
      databaseType.appendEscapedWord(sb, fieldType.convertJavaFieldToSqlArgValue(argOrValue).toString());
    } else {
View Full Code Here

Examples of com.j256.ormlite.field.FieldType.extractJavaFieldValue()

      /*
       * 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.
       */
      FieldType idFieldType = fieldType.getForeignIdField();
      appendArgOrValue(databaseType, idFieldType, sb, argList, idFieldType.extractJavaFieldValue(argOrValue));
      // no need for the space since it was done in the recursion
      appendSpace = false;
    } else if (fieldType.isEscapedValue()) {
      databaseType.appendEscapedWord(sb, fieldType.convertJavaFieldToSqlArgValue(argOrValue).toString());
    } else if (fieldType.isForeign()) {
View Full Code Here

Examples of com.j256.ormlite.field.FieldType.extractJavaFieldValue()

    FieldType idField = tableInfo.getIdField();
    if (idField == null) {
      throw new SQLException("Class " + dataClass + " does not have an id field");
    }
    @SuppressWarnings("unchecked")
    ID id = (ID) idField.extractJavaFieldValue(data);
    return id;
  }

  public Class<T> getDataClass() {
    return dataClass;
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.