本文整理汇总了Java中org.skife.jdbi.v2.sqlobject.SqlBatch类的典型用法代码示例。如果您正苦于以下问题:Java SqlBatch类的具体用法?Java SqlBatch怎么用?Java SqlBatch使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SqlBatch类属于org.skife.jdbi.v2.sqlobject包,在下文中一共展示了SqlBatch类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: bulkInsert
import org.skife.jdbi.v2.sqlobject.SqlBatch; //导入依赖的package包/类
@SqlBatch("insert into repositories " +
"(id, owner_id, name, full_name, description, fork, homepage, stargazers_count, language, created_at, updated_at, fetched_at) " +
"values (:id, :ownerId, :name, :fullName, :description, :fork, :homepage, :stargazersCount, :language, current_timestamp(), current_timestamp(), current_timestamp()) " +
"on duplicate key update " +
"owner_id=values(owner_id), name=values(name), full_name=values(full_name), description=values(description), homepage=values(homepage), stargazers_count=values(stargazers_count), language=values(language), updated_at=values(updated_at), fetched_at=values(fetched_at)")
@BatchChunkSize(100)
void bulkInsert(@BindBean List<Repository> repos);
示例2: updateCleanedShardNodes
import org.skife.jdbi.v2.sqlobject.SqlBatch; //导入依赖的package包/类
@SqlBatch("UPDATE deleted_shard_nodes SET clean_time = CURRENT_TIMESTAMP\n" +
"WHERE shard_uuid = :shardUuid\n" +
" AND node_id = :nodeId\n" +
" AND clean_time IS NULL\n")
void updateCleanedShardNodes(
@Bind("shardUuid") Iterable<UUID> shardUuids,
@Bind("nodeId") int nodeId);
示例3: updatePurgedShardNodes
import org.skife.jdbi.v2.sqlobject.SqlBatch; //导入依赖的package包/类
@SqlBatch("UPDATE deleted_shard_nodes SET purge_time = CURRENT_TIMESTAMP\n" +
"WHERE shard_uuid = :shardUuid\n" +
" AND node_id = :nodeId\n" +
" AND purge_time IS NULL\n")
void updatePurgedShardNodes(
@Bind("shardUuid") Iterable<UUID> shardUuids,
@Bind("nodeId") int nodeId);
示例4: trusteduser
import org.skife.jdbi.v2.sqlobject.SqlBatch; //导入依赖的package包/类
@SqlBatch("MERGE INTO trusteduser (facebookid, macaddress, lastaccess) "
+ "VALUES (:t.facebookid, "
+ "COALESCE((SELECT macaddress FROM trusteduser "
+ "WHERE facebookid = :t.facebookid), :t.macaddress), "
+ "COALESCE((SELECT lastaccess FROM trusteduser "
+ "WHERE facebookid = :t.facebookid), :t.lastaccess)"
+ ")")
@BatchChunkSize(1000)
public abstract void insertAll(@BindTrustedUser("t") Iterator<TrustedUser> trustedUsers);
示例5: content
import org.skife.jdbi.v2.sqlobject.SqlBatch; //导入依赖的package包/类
@SqlBatch("INSERT INTO content (contentid, size, url, path, "
+ "quality, cachetype, cachedate, cachescore, "
+ "category, downloaded, prefetched, vimeoprefetched) "
+ "VALUES (:c.contentid, :c.size, :c.url, :c.path, "
+ ":c.quality, :c.cachetype , :c.cachedate , :c.cachescore, "
+ ":c.category, :c.downloaded, :c.prefetched, :c.vimeoprefetched)")
@BatchChunkSize(1000)
public abstract void insertAll(@BindContent("c") Iterator<Content> contents);
示例6: insertBatchByLinkId
import org.skife.jdbi.v2.sqlobject.SqlBatch; //导入依赖的package包/类
@SqlBatch("INSERT INTO SEGMENT "
+ "(LOCALLINKID, LOCALISPNAME, LEFTBORDER, RIGHTBORDER, A, B) "
+ "VALUES (:l.localLinkID, :l.localIspName, "
+ ":costFunctionID , :s.leftBorder, :s.rightBorder, :s.a, :s.b)")
@BatchChunkSize(1000)
public abstract void insertBatchByLinkId(@BindBean("s") List<Segment> slist,
@BindBean("l") SimpleLinkID linkID);
示例7: SNM_MONITOR_TASK
import org.skife.jdbi.v2.sqlobject.SqlBatch; //导入依赖的package包/类
@SqlBatch("INSERT INTO SNM_MONITOR_TASK(MONITOR_ID, TASK_ID) VALUES (:monitorId, :taskId)")
@BatchChunkSize(1000)
void insertMonitorTask(@Bind("monitorId")List<String> monitorIds, @Bind("taskId") String taskId);
示例8: values
import org.skife.jdbi.v2.sqlobject.SqlBatch; //导入依赖的package包/类
@SqlBatch("insert into \"<schema>\".<entry_table>(entry_number, timestamp, key, type) values(:entry_number, :timestampAsLong, :key, :entryType::\"<schema>\".ENTRY_TYPE)")
@BatchChunkSize(1000)
void insertInBatch(@BindEntry Iterable<Entry> entries, @Define("schema") String schema, @Define("entry_table") String entryTable);
示例9: values
import org.skife.jdbi.v2.sqlobject.SqlBatch; //导入依赖的package包/类
@SqlBatch("insert into \"<schema>\".<entry_item_table>(entry_number, sha256hex) values (:entryNumber, :sha256hex)")
@BatchChunkSize(1000)
void insertInBatch(@BindBean Iterable<EntryItemPair> entries, @Define("schema") String schema, @Define("entry_item_table") String entryItemTable);
示例10: values
import org.skife.jdbi.v2.sqlobject.SqlBatch; //导入依赖的package包/类
@SqlBatch("insert into \"<schema>\".index (name, key, sha256hex, start_entry_number, start_index_entry_number) values (:indexName, :key, :itemHash, :startEntryNumber, :startIndexEntryNumber)")
@BatchChunkSize(1000)
void startInBatch(@BindBean Iterable<StartIndex> indexes, @Define("schema") String schema);
示例11: endInBatch
import org.skife.jdbi.v2.sqlobject.SqlBatch; //导入依赖的package包/类
@SqlBatch("update \"<schema>\".index i set end_entry_number = :endEntryNumber, end_index_entry_number = :endIndexEntryNumber from \"<schema>\".<entry_table> e where e.entry_number = i.start_entry_number and e.entry_number = :entryNumberToEnd and e.key = :entryKey and i.name = :indexName and i.key = :indexKey and i.sha256hex = :itemHash")
@BatchChunkSize(1000)
void endInBatch(@BindBean Iterable<EndIndex> indexes, @Define("schema") String schema, @Define("entry_table") String entryTable);
示例12: values
import org.skife.jdbi.v2.sqlobject.SqlBatch; //导入依赖的package包/类
@SqlBatch("insert into \"<schema>\".item(sha256hex, content) values(:sha256hex, :content) on conflict do nothing")
@BatchChunkSize(1000)
void insertInBatch(@BindItem Iterable<Item> items, @Define("schema") String schema );
示例13: phones
import org.skife.jdbi.v2.sqlobject.SqlBatch; //导入依赖的package包/类
@SqlBatch("INSERT INTO phones (id, contactId, type, phone) VALUES (:id, :contactId, :type, :phone)")
void insertPhones(@BindBean List<Phone> phones, @Bind("contactId") int contactId);
示例14: insertRepairSegments
import org.skife.jdbi.v2.sqlobject.SqlBatch; //导入依赖的package包/类
@SqlBatch(SQL_INSERT_REPAIR_SEGMENT)
@BatchChunkSize(500)
void insertRepairSegments(
@BindBean Iterator<RepairSegment> newRepairSegments);
示例15: repository_ranks
import org.skife.jdbi.v2.sqlobject.SqlBatch; //导入依赖的package包/类
@SqlBatch("insert into repository_ranks (stargazers_count, rank, created_at, updated_at) " +
"values (:stargazersCount, :rank, current_timestamp(), current_timestamp())")
@BatchChunkSize(5000)
void bulkInsert(@BindBean List<RepositoryRank> repoRanks);