Codota Logo
TypeConverterFactory.getTypeConverter
Code IndexAdd Codota to your IDE (free)

How to use
getTypeConverter
method
in
com.jporm.types.TypeConverterFactory

Best Java code snippets using com.jporm.types.TypeConverterFactory.getTypeConverter (Showing top 4 results out of 315)

origin: com.jporm/jporm-core

@Override
public int[] batchUpdate(final String sql, final Stream<Object[]> args) throws JpoException {
  return sqlPerformerStrategy.batchUpdate(sql, args.map(values -> {
  Object[] unwrappedValues = new Object[values.length];
  for (int i=0; i<values.length; i++) {
    Object object = values[i];
    if (object!=null) {
      TypeConverterJdbcReady<Object, Object> typeWrapper = (TypeConverterJdbcReady<Object, Object>) typeFactory.getTypeConverter(object.getClass());
      unwrappedValues[i] = typeWrapper.toJdbcType(object);
    }
  }
  return unwrappedValues;
}));
}
origin: com.jporm/jporm-core

  @Override
  public void set(final PreparedStatement ps) throws SQLException {
    if (logger.isDebugEnabled()) {
      logger.debug("Query params: " + Arrays.asList(args)); //$NON-NLS-1$
    }
    int index = 0;
    for (Object object : args) {
      if (object!=null) {
        TypeConverterJdbcReady<Object, Object> typeWrapper = (TypeConverterJdbcReady<Object, Object>) typeFactory.getTypeConverter(object.getClass());
        typeWrapper.getJdbcIO().setValueToPreparedStatement( typeWrapper.toJdbcType(object) , ps, ++index);
      } else {
        ps.setObject(++index, object);
      }
    }
  }
}
origin: com.jporm/jporm-core

@Override
public void set(final PreparedStatement ps) throws SQLException {
  if (logger.isDebugEnabled()) {
    logger.debug("Query params: " + args); //$NON-NLS-1$
  }
  int index = 0;
  for (Object object : args) {
    if (object!=null) {
      TypeConverterJdbcReady<Object, Object> typeWrapper = (TypeConverterJdbcReady<Object, Object>) typeFactory.getTypeConverter(object.getClass());
      typeWrapper.getJdbcIO().setValueToPreparedStatement( typeWrapper.toJdbcType(object) , ps, ++index);
    } else {
      ps.setObject(++index, object);
    }
  }
}
origin: com.jporm/jpo-commons-core

@SuppressWarnings("unchecked")
protected void setToStatement(final int index, final Object value, final Statement statement) {
  if (value != null) {
    final TypeConverter<Object, Object> typeWrapper = (TypeConverter<Object, Object>) getTypeFactory().getTypeConverter(value.getClass());
    typeWrapper.getJdbcIO().setValueToPreparedStatement(typeWrapper.toJdbcType(value), statement, index);
  } else {
    statement.setObject(index, value);
  }
}
com.jporm.typesTypeConverterFactorygetTypeConverter

Popular methods of TypeConverterFactory

  • addTypeConverter
  • <init>

Popular in Java

  • Running tasks concurrently on multiple threads
  • getSupportFragmentManager (FragmentActivity)
  • onRequestPermissionsResult (Fragment)
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • Set (java.util)
    A collection that contains no duplicate elements. More formally, sets contain no pair of elements e1
  • SortedSet (java.util)
    A Set that further provides a total ordering on its elements. The elements are ordered using their C
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • JTable (javax.swing)
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