Codota Logo
RegisterMapperFactory
Code IndexAdd Codota to your IDE (free)

How to use
RegisterMapperFactory
in
org.skife.jdbi.v2.sqlobject.customizers

Best Java code snippets using org.skife.jdbi.v2.sqlobject.customizers.RegisterMapperFactory (Showing top 14 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew LinkedList()
  • Codota IconCollections.emptyList()
  • Codota Iconnew ArrayList()
  • Smart code suggestions by Codota
}
origin: org.jdbi/jdbi

@RegisterMapperFactory(MyFactory.class)
public static interface FooDao
{
  @SqlQuery("select * from something")
  List<Foo> select();
  @SqlUpdate("insert into something (id, name) VALUES (:id, :name)")
  void insert(@Bind("id") int id, @Bind("name") String name);
}
origin: com.ning.billing/killbill-osgi-bundles-analytics

public SqlStatementCustomizer createForType(Annotation annotation, Class sqlObjectType)
{
  final RegisterMapperFactory ma = (RegisterMapperFactory) annotation;
  final ResultSetMapperFactory[] m = new ResultSetMapperFactory[ma.value().length];
  try {
    Class<? extends ResultSetMapperFactory>[] mcs = ma.value();
    for (int i = 0; i < mcs.length; i++) {
      m[i] = mcs[i].newInstance();
    }
  }
  catch (Exception e) {
    throw new IllegalStateException("unable to create a specified result set mapper", e);
  }
  return new SqlStatementCustomizer()
  {
    public void apply(SQLStatement statement)
    {
      if (statement instanceof Query) {
        Query q = (Query) statement;
        for (ResultSetMapperFactory factory : m) {
          q.registerMapper(factory);
        }
      }
    }
  };
}
origin: org.kill-bill.commons/killbill-jdbi

@RegisterMapperFactory(MyFactory.class)
public static interface FooDao
{
  @SqlQuery("select * from something")
  List<Foo> select();
  @SqlUpdate("insert into something (id, name) VALUES (:id, :name)")
  void insert(@Bind("id") int id, @Bind("name") String name);
}
origin: com.ning.billing/killbill-osgi-bundles-analytics

public SqlStatementCustomizer createForMethod(Annotation annotation, Class sqlObjectType, Method method)
{
  final RegisterMapperFactory ma = (RegisterMapperFactory) annotation;
  final ResultSetMapperFactory[] m = new ResultSetMapperFactory[ma.value().length];
  try {
    Class<? extends ResultSetMapperFactory>[] mcs = ma.value();
    for (int i = 0; i < mcs.length; i++) {
      m[i] = mcs[i].newInstance();
    }
  }
  catch (Exception e) {
    throw new IllegalStateException("unable to create a specified result set mapper", e);
  }
  return new SqlStatementCustomizer()
  {
    public void apply(SQLStatement statement)
    {
      if (statement instanceof Query) {
        Query q = (Query) statement;
        for (ResultSetMapperFactory factory : m) {
          q.registerMapper(factory);
        }
      }
    }
  };
}
origin: com.facebook.presto/presto-raptor

@RegisterArgumentFactory(UuidArgumentFactory.class)
@RegisterMapperFactory(UuidMapperFactory.class)
public interface H2ShardDao
    extends ShardDao
{
  @Override
  @SqlBatch("MERGE INTO deleted_shards (shard_uuid, delete_time)\n" +
      "VALUES (:shardUuid, CURRENT_TIMESTAMP)")
  void insertDeletedShards(@Bind("shardUuid") Iterable<UUID> shardUuids);

  @SqlUpdate("DELETE FROM transactions\n" +
      "WHERE end_time < :maxEndTime\n" +
      "  AND successful IN (TRUE, FALSE)\n" +
      "  AND transaction_id NOT IN (SELECT transaction_id FROM created_shards)\n" +
      "LIMIT " + CLEANUP_TRANSACTIONS_BATCH_SIZE)
  int deleteOldCompletedTransactions(@Bind("maxEndTime") Timestamp maxEndTime);
}

origin: org.kill-bill.commons/killbill-jdbi

@Override
public SqlStatementCustomizer createForMethod(Annotation annotation, Class sqlObjectType, Method method)
{
  final RegisterMapperFactory ma = (RegisterMapperFactory) annotation;
  final ResultSetMapperFactory[] m = new ResultSetMapperFactory[ma.value().length];
  try {
    Class<? extends ResultSetMapperFactory>[] mcs = ma.value();
    for (int i = 0; i < mcs.length; i++) {
      m[i] = mcs[i].newInstance();
    }
  }
  catch (Exception e) {
    throw new IllegalStateException("unable to create a specified result set mapper", e);
  }
  return new SqlStatementCustomizer()
  {
    @Override
    public void apply(SQLStatement statement)
    {
      if (statement instanceof Query) {
        Query q = (Query) statement;
        for (ResultSetMapperFactory factory : m) {
          q.registerMapper(factory);
        }
      }
    }
  };
}
origin: prestosql/presto

@RegisterArgumentFactory(UuidArgumentFactory.class)
@RegisterMapperFactory(UuidMapperFactory.class)
public interface H2ShardDao
    extends ShardDao
{
  @Override
  @SqlBatch("MERGE INTO deleted_shards (shard_uuid, delete_time)\n" +
      "VALUES (:shardUuid, CURRENT_TIMESTAMP)")
  void insertDeletedShards(@Bind("shardUuid") Iterable<UUID> shardUuids);

  @SqlUpdate("DELETE FROM transactions\n" +
      "WHERE end_time < :maxEndTime\n" +
      "  AND successful IN (TRUE, FALSE)\n" +
      "  AND transaction_id NOT IN (SELECT transaction_id FROM created_shards)\n" +
      "LIMIT " + CLEANUP_TRANSACTIONS_BATCH_SIZE)
  int deleteOldCompletedTransactions(@Bind("maxEndTime") Timestamp maxEndTime);
}

origin: org.kill-bill.commons/killbill-jdbi

@Override
public SqlStatementCustomizer createForType(Annotation annotation, Class sqlObjectType)
{
  final RegisterMapperFactory ma = (RegisterMapperFactory) annotation;
  final ResultSetMapperFactory[] m = new ResultSetMapperFactory[ma.value().length];
  try {
    Class<? extends ResultSetMapperFactory>[] mcs = ma.value();
    for (int i = 0; i < mcs.length; i++) {
      m[i] = mcs[i].newInstance();
    }
  }
  catch (Exception e) {
    throw new IllegalStateException("unable to create a specified result set mapper", e);
  }
  return new SqlStatementCustomizer()
  {
    @Override
    public void apply(SQLStatement statement)
    {
      if (statement instanceof Query) {
        Query q = (Query) statement;
        for (ResultSetMapperFactory factory : m) {
          q.registerMapper(factory);
        }
      }
    }
  };
}
origin: prestosql/presto

@RegisterArgumentFactory(UuidArgumentFactory.class)
@RegisterMapperFactory(UuidMapperFactory.class)
public interface MySqlShardDao
    extends ShardDao
{
  @Override
  @SqlUpdate("DELETE x\n" +
      "FROM shard_nodes x\n" +
      "JOIN shards USING (shard_id)\n" +
      "WHERE table_id = :tableId")
  void dropShardNodes(@Bind("tableId") long tableId);

  @Override
  @SqlBatch("INSERT IGNORE INTO deleted_shards (shard_uuid, delete_time)\n" +
      "VALUES (:shardUuid, CURRENT_TIMESTAMP)")
  void insertDeletedShards(@Bind("shardUuid") Iterable<UUID> shardUuids);

  // 'order by' is needed in this statement in order to make it compatible with statement-based replication
  @SqlUpdate("DELETE FROM transactions\n" +
      "WHERE end_time < :maxEndTime\n" +
      "  AND successful IN (TRUE, FALSE)\n" +
      "  AND transaction_id NOT IN (SELECT transaction_id FROM created_shards)\n" +
      "ORDER BY end_time, transaction_id\n" +
      "LIMIT " + CLEANUP_TRANSACTIONS_BATCH_SIZE)
  int deleteOldCompletedTransactions(@Bind("maxEndTime") Timestamp maxEndTime);
}

origin: com.facebook.presto/presto-raptor

@RegisterArgumentFactory(UuidArgumentFactory.class)
@RegisterMapperFactory(UuidMapperFactory.class)
public interface MySqlShardDao
    extends ShardDao
{
  @Override
  @SqlUpdate("DELETE x\n" +
      "FROM shard_nodes x\n" +
      "JOIN shards USING (shard_id)\n" +
      "WHERE table_id = :tableId")
  void dropShardNodes(@Bind("tableId") long tableId);

  @Override
  @SqlBatch("INSERT IGNORE INTO deleted_shards (shard_uuid, delete_time)\n" +
      "VALUES (:shardUuid, CURRENT_TIMESTAMP)")
  void insertDeletedShards(@Bind("shardUuid") Iterable<UUID> shardUuids);

  // 'order by' is needed in this statement in order to make it compatible with statement-based replication
  @SqlUpdate("DELETE FROM transactions\n" +
      "WHERE end_time < :maxEndTime\n" +
      "  AND successful IN (TRUE, FALSE)\n" +
      "  AND transaction_id NOT IN (SELECT transaction_id FROM created_shards)\n" +
      "ORDER BY end_time, transaction_id\n" +
      "LIMIT " + CLEANUP_TRANSACTIONS_BATCH_SIZE)
  int deleteOldCompletedTransactions(@Bind("maxEndTime") Timestamp maxEndTime);
}

origin: org.jdbi/jdbi

@RegisterMapperFactory(BeanMapperFactory.class)
@RegisterColumnMapper(ValueTypeMapper.class)
public interface TestDao
{
  @SqlQuery("select * from testBean")
  List<TestBean> listBeans();
  @SqlQuery("select * from testBean")
  List<String> listStrings();
  @SqlQuery("select * from testBean")
  List<TestEnum> listEnums();
  @SqlQuery("select * from testBean")
  List<ValueType> listValueTypes();
}
origin: com.facebook.presto/presto-raptor

@RegisterArgumentFactory(UuidArgumentFactory.class)
@RegisterMapperFactory(UuidMapperFactory.class)
public interface ShardDao
origin: prestosql/presto

@RegisterArgumentFactory(UuidArgumentFactory.class)
@RegisterMapperFactory(UuidMapperFactory.class)
public interface ShardDao
origin: prestosql/presto

@RegisterArgumentFactory(UuidArgumentFactory.class)
@RegisterMapperFactory(UuidMapperFactory.class)
interface TestingShardDao
    extends H2ShardDao
org.skife.jdbi.v2.sqlobject.customizersRegisterMapperFactory

Most used methods

  • <init>
  • value

Popular in Java

  • Start an intent from android
  • getApplicationContext (Context)
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • orElseThrow (Optional)
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • Hashtable (java.util)
    Hashtable is a synchronized implementation of Map. All optional operations are supported.Neither key
  • PriorityQueue (java.util)
    An unbounded priority Queue based on a priority heap. The elements of the priority queue are ordered
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
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