Codota Logo
TableInfo.getFieldTypeByColumnName
Code IndexAdd Codota to your IDE (free)

How to use
getFieldTypeByColumnName
method
in
com.j256.ormlite.table.TableInfo

Best Java code snippets using com.j256.ormlite.table.TableInfo.getFieldTypeByColumnName (Showing top 14 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ArrayList a =
  • Codota Iconnew ArrayList<String>()
  • Codota Iconnew ArrayList()
  • Codota Iconnew ArrayList<Object>()
  • Smart code suggestions by Codota
}
origin: j256/ormlite-core

/**
 * Verify the columnName is valid and return its FieldType.
 * 
 * @throws IllegalArgumentException
 *             if the column name is not valid.
 */
protected FieldType verifyColumnName(String columnName) {
  return tableInfo.getFieldTypeByColumnName(columnName);
}
origin: com.j256.ormlite/ormlite-core

/**
 * Verify the columnName is valid and return its FieldType.
 * 
 * @throws IllegalArgumentException
 *             if the column name is not valid.
 */
protected FieldType verifyColumnName(String columnName) {
  return tableInfo.getFieldTypeByColumnName(columnName);
}
origin: j256/ormlite-core

private FieldType findColumnFieldType(String columnName) {
  return tableInfo.getFieldTypeByColumnName(columnName);
}
origin: com.j256.ormlite/ormlite-core

private FieldType findColumnFieldType(String columnName) {
  return tableInfo.getFieldTypeByColumnName(columnName);
}
origin: j256/ormlite-core

/**
 * Match up our joined fields so we can throw a nice exception immediately if you can't join with this type.
 */
private void matchJoinedFieldsByName(JoinInfo joinInfo, String localColumnName, String joinedColumnName,
    QueryBuilder<?, ?> joinedQueryBuilder) throws SQLException {
  joinInfo.localField = tableInfo.getFieldTypeByColumnName(localColumnName);
  if (joinInfo.localField == null) {
    throw new SQLException("Could not find field in " + tableInfo.getDataClass() + " that has column-name '"
        + localColumnName + "'");
  }
  joinInfo.remoteField = joinedQueryBuilder.tableInfo.getFieldTypeByColumnName(joinedColumnName);
  if (joinInfo.remoteField == null) {
    throw new SQLException("Could not find field in " + joinedQueryBuilder.tableInfo.getDataClass()
        + " that has column-name '" + joinedColumnName + "'");
  }
}
origin: com.j256.ormlite/ormlite-core

/**
 * Match up our joined fields so we can throw a nice exception immediately if you can't join with this type.
 */
private void matchJoinedFieldsByName(JoinInfo joinInfo, String localColumnName, String joinedColumnName,
    QueryBuilder<?, ?> joinedQueryBuilder) throws SQLException {
  joinInfo.localField = tableInfo.getFieldTypeByColumnName(localColumnName);
  if (joinInfo.localField == null) {
    throw new SQLException("Could not find field in " + tableInfo.getDataClass() + " that has column-name '"
        + localColumnName + "'");
  }
  joinInfo.remoteField = joinedQueryBuilder.tableInfo.getFieldTypeByColumnName(joinedColumnName);
  if (joinInfo.remoteField == null) {
    throw new SQLException("Could not find field in " + joinedQueryBuilder.tableInfo.getDataClass()
        + " that has column-name '" + joinedColumnName + "'");
  }
}
origin: com.j256.ormlite/ormlite-core

  @Override
  public T mapRow(String[] columnNames, String[] resultColumns) throws SQLException {
    // create our object
    T rowObj = tableInfo.createObject();
    for (int i = 0; i < columnNames.length; i++) {
      // sanity check, prolly will never happen but let's be careful out there
      if (i >= resultColumns.length) {
        continue;
      }
      // run through and convert each field
      FieldType fieldType = tableInfo.getFieldTypeByColumnName(columnNames[i]);
      Object fieldObj = fieldType.convertStringToJavaField(resultColumns[i], i);
      // assign it to the row object
      fieldType.assignField(rowObj, fieldObj, false, null);
    }
    return rowObj;
  }
}
origin: j256/ormlite-core

  continue;
FieldType fieldType = tableInfo.getFieldTypeByColumnName(select.getColumnName());
origin: com.j256.ormlite/ormlite-core

  continue;
FieldType fieldType = tableInfo.getFieldTypeByColumnName(select.getColumnName());
origin: j256/ormlite-core

  @Override
  public T mapRow(String[] columnNames, String[] resultColumns) throws SQLException {
    // create our object
    T rowObj = dao.createObjectInstance();
    for (int i = 0; i < columnNames.length; i++) {
      // sanity check, prolly will never happen but let's be careful out there
      if (i >= resultColumns.length) {
        continue;
      }
      // run through and convert each field
      FieldType fieldType = tableInfo.getFieldTypeByColumnName(columnNames[i]);
      Object fieldObj = fieldType.convertStringToJavaField(resultColumns[i], i);
      // assign it to the row object
      fieldType.assignField(dao.getConnectionSource(), rowObj, fieldObj, false, null);
    }
    return rowObj;
  }
}
origin: j256/ormlite-core

@Test
public void testUnknownForeignField() throws Exception {
  TableInfo<Foreign, Void> tableInfo = new TableInfo<Foreign, Void>(databaseType, Foreign.class);
  try {
    tableInfo.getFieldTypeByColumnName("foo");
    fail("expected exception");
  } catch (IllegalArgumentException e) {
    assertTrue(e.getMessage().contains("'" + Foreign.FOREIGN_FIELD_NAME + "'"));
    assertTrue(e.getMessage().contains("'foo'"));
  }
}
origin: j256/ormlite-core

  foreignRefField = foreignIdField;
} else {
  foreignRefField = foreignTableInfo.getFieldTypeByColumnName(foreignColumnName);
  if (foreignRefField == null) {
    throw new IllegalArgumentException(
origin: com.j256.ormlite/ormlite-core

  foreignRefField = foreignIdField;
} else {
  foreignRefField = foreignTableInfo.getFieldTypeByColumnName(foreignColumnName);
  if (foreignRefField == null) {
    throw new IllegalArgumentException(
origin: j256/ormlite-core

@Test
public void testBasic() throws SQLException {
  TableInfo<Foo, String> tableInfo = new TableInfo<Foo, String>(databaseType, Foo.class);
  assertEquals(Foo.class, tableInfo.getDataClass());
  assertEquals(TABLE_NAME, tableInfo.getTableName());
  assertEquals(COLUMN_NAME, tableInfo.getIdField().getColumnName());
  assertEquals(1, tableInfo.getFieldTypes().length);
  assertSame(tableInfo.getIdField(), tableInfo.getFieldTypes()[0]);
  assertEquals(COLUMN_NAME, tableInfo.getFieldTypeByColumnName(COLUMN_NAME).getColumnName());
}
com.j256.ormlite.tableTableInfogetFieldTypeByColumnName

Javadoc

Return the FieldType associated with the columnName.

Popular methods of TableInfo

  • <init>
  • getFieldTypes
    Return the array of field types associated with the object.
  • getTableName
    Return the name of the table associated with the object.
  • getIdField
    Return the id-field associated with the object.
  • getDataClass
    Return the class associated with this object-info.
  • objectToString
    Return a string representation of the object.
  • createObject
    Create and return an object of this type using our reflection constructor.
  • getForeignCollections
    Return an array with the fields that are ForeignCollections or a blank array if none.
  • hasColumnName
    Return true if this table information has a field with this columnName as set by DatabaseField#colum
  • isForeignAutoCreate
    Return true if one of the fields has DatabaseField#foreignAutoCreate() enabled.
  • isUpdatable
    Return true if we can update this object via its ID.
  • wireNewInstance
  • isUpdatable,
  • wireNewInstance

Popular in Java

  • Updating database using SQL prepared statement
  • getSupportFragmentManager (FragmentActivity)
  • addToBackStack (FragmentTransaction)
  • getApplicationContext (Context)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • PrintWriter (java.io)
    Prints formatted representations of objects to a text-output stream. This class implements all of th
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • Socket (java.net)
    Provides a client-side TCP socket.
  • TimerTask (java.util)
    A task that can be scheduled for one-time or repeated execution by a Timer.
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now