org.skife.jdbi.v2.sqlobject.Bind.value()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(4.9k)|赞(0)|评价(0)|浏览(109)

本文整理了Java中org.skife.jdbi.v2.sqlobject.Bind.value()方法的一些代码示例,展示了Bind.value()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bind.value()方法的具体详情如下:
包路径:org.skife.jdbi.v2.sqlobject.Bind
类名称:Bind
方法名:value

Bind.value介绍

暂无

代码示例

代码示例来源:origin: killbill/killbill

private List<String> retrieveEntityIdsFromArguments(final Method method, final Object[] args) {
  final Annotation[][] parameterAnnotations = getAnnotations(method);
  int i = -1;
  for (final Object arg : args) {
    i++;
    // Assume the first argument of type Entity is our type of Entity (type U here)
    // This is true for e.g. create calls
    if (arg instanceof Entity) {
      return ImmutableList.<String>of(((Entity) arg).getId().toString());
    }
    // For Batch calls, the first argument will be of type List<Entity>
    if (arg instanceof Iterable) {
      final Builder<String> entityIds = extractEntityIdsFromBatchArgument((Iterable) arg);
      if (entityIds != null) {
        return entityIds.build();
      }
    }
    for (final Annotation annotation : parameterAnnotations[i]) {
      if (arg instanceof String && Bind.class.equals(annotation.annotationType()) && ("id").equals(((Bind) annotation).value())) {
        return ImmutableList.<String>of((String) arg);
      } else if (arg instanceof Collection && BindIn.class.equals(annotation.annotationType()) && ("ids").equals(((BindIn) annotation).value())) {
        return ImmutableList.<String>copyOf((Collection) arg);
      }
    }
  }
  return ImmutableList.<String>of();
}

代码示例来源:origin: org.kill-bill.commons/killbill-jdbi

@Override
public void bind(SQLStatement q, Bind b, Object arg)
{
  q.bind(b.value(), arg);
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-analytics

public void bind(SQLStatement q, Bind b, Object arg)
{
  q.bind(b.value(), arg);
}

代码示例来源:origin: io.ifar.skid-road/skid-road-jdbi

@Override
  public void bind(SQLStatement<?> q, Bind bind, Collection<String> arg) {
    Array a = null;
    if (arg != null) {
      try {
        a = q.getContext().getConnection().createArrayOf("varchar",arg.toArray());
      } catch (SQLException se) {
        throw new RuntimeException(String.format("Unable to bind collection {%s} to a SQL array: (%s) %s",
            Joiner.on(" ,").join(arg), se.getClass(), se.getMessage()),se);
      }
    }
    q.bindBySqlType(bind.value(),a, Types.ARRAY);
  }
}

代码示例来源:origin: com.ning.billing/killbill-util

private List<String> retrieveEntityIdsFromArguments(final Method method, final Object[] args) {
  final Annotation[][] parameterAnnotations = method.getParameterAnnotations();
  int i = -1;
  for (final Object arg : args) {
    i++;
    // Assume the first argument of type Entity is our type of Entity (type U here)
    // This is true for e.g. create calls
    if (arg instanceof Entity) {
      return ImmutableList.<String>of(((Entity) arg).getId().toString());
    }
    // For Batch calls, the first argument will be of type List<Entity>
    if (arg instanceof Iterable) {
      final Builder<String> entityIds = extractEntityIdsFromBatchArgument((Iterable) arg);
      if (entityIds != null) {
        return entityIds.build();
      }
    }
    // Otherwise, use the first String argument, annotated with @Bind("id")
    // This is true for e.g. update calls
    if (!(arg instanceof String)) {
      continue;
    }
    for (final Annotation annotation : parameterAnnotations[i]) {
      if (Bind.class.equals(annotation.annotationType()) && ("id").equals(((Bind) annotation).value())) {
        return ImmutableList.<String>of((String) arg);
      }
    }
  }
  return null;
}

代码示例来源:origin: org.kill-bill.billing/killbill-util

private List<String> retrieveEntityIdsFromArguments(final Method method, final Object[] args) {
  final Annotation[][] parameterAnnotations = getAnnotations(method);
  int i = -1;
  for (final Object arg : args) {
    i++;
    // Assume the first argument of type Entity is our type of Entity (type U here)
    // This is true for e.g. create calls
    if (arg instanceof Entity) {
      return ImmutableList.<String>of(((Entity) arg).getId().toString());
    }
    // For Batch calls, the first argument will be of type List<Entity>
    if (arg instanceof Iterable) {
      final Builder<String> entityIds = extractEntityIdsFromBatchArgument((Iterable) arg);
      if (entityIds != null) {
        return entityIds.build();
      }
    }
    for (final Annotation annotation : parameterAnnotations[i]) {
      if (arg instanceof String && Bind.class.equals(annotation.annotationType()) && ("id").equals(((Bind) annotation).value())) {
        return ImmutableList.<String>of((String) arg);
      } else if (arg instanceof Collection && BindIn.class.equals(annotation.annotationType()) && ("ids").equals(((BindIn) annotation).value())) {
        return ImmutableList.<String>copyOf((Collection) arg);
      }
    }
  }
  return ImmutableList.<String>of();
}

代码示例来源:origin: stackoverflow.com

String value = bind.value();
String propValue = props.getProperty(value);
System.out.println(field.getName()+":"+value+":"+propValue);

代码示例来源:origin: org.kill-bill.commons/killbill-jdbi

@Override
  public void bind(SQLStatement q, Bind bind, Something it)
  {
    q.bind(bind.value() + ".id", it.getId());
    q.bind(bind.value() + ".name", it.getName());
  }
}

代码示例来源:origin: org.jdbi/jdbi

@Override
  public void bind(SQLStatement q, Bind bind, Something it)
  {
    q.bind(bind.value() + ".id", it.getId());
    q.bind(bind.value() + ".name", it.getName());
  }
}

相关文章

微信公众号

最新文章

更多