Java Code Examples for org.skife.jdbi.v2.sqlobject.GetGeneratedKeys

The following examples show how to use org.skife.jdbi.v2.sqlobject.GetGeneratedKeys. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: presto   Source File: MetadataDao.java    License: Apache License 2.0 6 votes vote down vote up
@SqlUpdate("INSERT INTO tables (\n" +
        "  schema_name, table_name, compaction_enabled, organization_enabled, distribution_id,\n" +
        "  create_time, update_time, table_version,\n" +
        "  shard_count, row_count, compressed_size, uncompressed_size)\n" +
        "VALUES (\n" +
        "  :schemaName, :tableName, :compactionEnabled, :organizationEnabled, :distributionId,\n" +
        "  :createTime, :createTime, 0,\n" +
        "  0, 0, 0, 0)\n")
@GetGeneratedKeys
long insertTable(
        @Bind("schemaName") String schemaName,
        @Bind("tableName") String tableName,
        @Bind("compactionEnabled") boolean compactionEnabled,
        @Bind("organizationEnabled") boolean organizationEnabled,
        @Bind("distributionId") Long distributionId,
        @Bind("createTime") long createTime);
 
Example 2
Source Project: digdag   Source File: DatabaseSessionStoreManager.java    License: Apache License 2.0 6 votes vote down vote up
@SqlUpdate("insert into resuming_tasks (attempt_id, source_task_id, full_name, updated_at, local_config, export_config, subtask_config, export_params, store_params, report, error, reset_store_params)" +
        " values (:attemptId, :sourceTaskId, :fullName, :updatedAt, :localConfig, :exportConfig, :subtaskConfig, :exportParams, :storeParams, :report, :error, :reset_store_params)")
@GetGeneratedKeys
long insertResumingTask(
        @Bind("attemptId") long attemptId,
        @Bind("sourceTaskId") long sourceTaskId,
        @Bind("fullName") String fullName,
        @Bind("updatedAt") java.sql.Timestamp updatedAt,
        @Bind("localConfig") Config localConfig,
        @Bind("exportConfig") Config exportConfig,
        @Bind("subtaskConfig") Config subtaskConfig,
        @Bind("exportParams") Config exportParams,
        @Bind("reset_store_params") String resetStoreParams,
        @Bind("storeParams") Config storeParams,
        @Bind("report") Config report,
        @Bind("error") Config error);
 
Example 3
Source Project: airpal   Source File: JobDAO.java    License: Apache License 2.0 6 votes vote down vote up
@SqlUpdate(
        "INSERT INTO jobs (query, user, uuid, queryStats, state, columns, query_finished, query_started, error) " +
        "VALUES (" +
                ":query, " +
                ":user, " +
                ":uuid, " +
                ":queryStats, " +
                ":state, " +
                ":columns, " +
                ":queryFinished, " +
                ":queryStarted, " +
                ":error)")
@GetGeneratedKeys
long createJob(
        @RosettaBinder Job job
);
 
Example 4
Source Project: presto   Source File: MetadataDao.java    License: Apache License 2.0 5 votes vote down vote up
@SqlUpdate("INSERT INTO distributions (distribution_name, column_types, bucket_count)\n" +
        "VALUES (:distributionName, :columnTypes, :bucketCount)")
@GetGeneratedKeys
long insertDistribution(
        @Bind("distributionName") String distributionName,
        @Bind("columnTypes") String columnTypes,
        @Bind("bucketCount") int bucketCount);
 
Example 5
Source Project: presto   Source File: TestingShardDao.java    License: Apache License 2.0 5 votes vote down vote up
@SqlUpdate("INSERT INTO shards (shard_uuid, table_id, bucket_number, create_time, row_count, compressed_size, uncompressed_size, xxhash64)\n" +
        "VALUES (:shardUuid, :tableId, :bucketNumber, CURRENT_TIMESTAMP, :rowCount, :compressedSize, :uncompressedSize, :xxhash64)")
@GetGeneratedKeys
long insertShard(
        @Bind("shardUuid") UUID shardUuid,
        @Bind("tableId") long tableId,
        @Bind("bucketNumber") Integer bucketNumber,
        @Bind("rowCount") long rowCount,
        @Bind("compressedSize") long compressedSize,
        @Bind("uncompressedSize") long uncompressedSize,
        @Bind("xxhash64") long xxhash64);
 
Example 6
Source Project: quark   Source File: ViewDAO.java    License: Apache License 2.0 5 votes vote down vote up
@GetGeneratedKeys
@SqlUpdate("insert into partitions(name, description, query, cost, destination_id, "
    + "schema_name, table_name, ds_set_id) values(:name, :description, :query, :cost, "
    + ":destination_id, :schema_name, :table_name, :ds_set_id)")
int insert(@Bind("name") String name, @Bind("description") String description,
           @Bind("query") String query, @Bind("cost") long cost,
           @Bind("destination_id") long destinationId, @Bind("schema_name") String schemaName,
           @Bind("table_name") String tableName, @Bind("ds_set_id") long dsSetId);
 
Example 7
Source Project: airpal   Source File: JobOutputDAO.java    License: Apache License 2.0 5 votes vote down vote up
@SqlUpdate(
        "INSERT INTO job_outputs (type, description, location, job_id) " +
                "VALUES (:type, :description, :location, :jobId)")
@GetGeneratedKeys
long createJobOutput(
        @BindBean PersistentJobOutput output,
        @Bind("jobId") long jobId
);
 
Example 8
Source Project: presto   Source File: ShardDao.java    License: Apache License 2.0 4 votes vote down vote up
@SqlUpdate("INSERT INTO nodes (node_identifier) VALUES (:nodeIdentifier)")
@GetGeneratedKeys
int insertNode(@Bind("nodeIdentifier") String nodeIdentifier);
 
Example 9
Source Project: presto   Source File: ShardDao.java    License: Apache License 2.0 4 votes vote down vote up
@SqlUpdate("INSERT INTO transactions (start_time) VALUES (CURRENT_TIMESTAMP)")
@GetGeneratedKeys
long insertTransaction();
 
Example 10
Source Project: presto   Source File: TestShardCleaner.java    License: Apache License 2.0 4 votes vote down vote up
@SqlUpdate("INSERT INTO transactions (start_time) VALUES (:startTime)")
@GetGeneratedKeys
long insertTransaction(@Bind("startTime") Timestamp timestamp);
 
Example 11
Source Project: cassandra-reaper   Source File: IStoragePostgreSql.java    License: Apache License 2.0 4 votes vote down vote up
@SqlUpdate(SQL_INSERT_REPAIR_RUN)
@GetGeneratedKeys
long insertRepairRun(
    @BindBean RepairRun newRepairRun);
 
Example 12
Source Project: cassandra-reaper   Source File: IStoragePostgreSql.java    License: Apache License 2.0 4 votes vote down vote up
@SqlUpdate(SQL_INSERT_REPAIR_UNIT)
@GetGeneratedKeys
long insertRepairUnit(
    @BindBean RepairUnit newRepairUnit);
 
Example 13
Source Project: cassandra-reaper   Source File: IStoragePostgreSql.java    License: Apache License 2.0 4 votes vote down vote up
@SqlUpdate(SQL_INSERT_REPAIR_SCHEDULE)
@GetGeneratedKeys
long insertRepairSchedule(
    @BindBean RepairSchedule newRepairSchedule);
 
Example 14
Source Project: cassandra-reaper   Source File: IStoragePostgreSql.java    License: Apache License 2.0 4 votes vote down vote up
@SqlUpdate(SQL_INSERT_EVENT_SUBSCRIPTION)
@GetGeneratedKeys
long insertDiagEventSubscription(
        @BindBean DiagEventSubscription subscription);
 
Example 15
Source Project: digdag   Source File: DatabaseProjectStoreManager.java    License: Apache License 2.0 4 votes vote down vote up
@SqlUpdate("insert into workflow_configs" +
        " (project_id, config, timezone, config_digest)" +
        " values (:projId, :config, :timezone, :configDigest)")
@GetGeneratedKeys
int insertWorkflowConfig(@Bind("projId") int projId, @Bind("config") String config, @Bind("timezone") String timezone, @Bind("configDigest") long configDigest);
 
Example 16
Source Project: digdag   Source File: DatabaseProjectStoreManager.java    License: Apache License 2.0 4 votes vote down vote up
@SqlUpdate("insert into revisions" +
        " (project_id, name, default_params, archive_type, archive_md5, archive_path, user_info, created_at)" +
        " values (:projId, :name, :defaultParams, :archiveType, :archiveMd5, :archivePath, :userInfo, now())")
@GetGeneratedKeys
int insertRevision(@Bind("projId") int projId, @Bind("name") String name, @Bind("defaultParams") Config defaultParams, @Bind("archiveType") String archiveType, @Bind("archiveMd5") byte[] archiveMd5, @Bind("archivePath") String archivePath, @Bind("userInfo") Config userInfo);
 
Example 17
Source Project: digdag   Source File: DatabaseProjectStoreManager.java    License: Apache License 2.0 4 votes vote down vote up
@SqlUpdate("insert into workflow_definitions" +
        " (revision_id, name, config_id)" +
        " values (:revId, :name, :configId)")
@GetGeneratedKeys
long insertWorkflowDefinition(@Bind("revId") int revId, @Bind("name") String name, @Bind("configId") int configId);
 
Example 18
Source Project: digdag   Source File: DatabaseProjectStoreManager.java    License: Apache License 2.0 4 votes vote down vote up
@SqlUpdate("insert into schedules" +
            " (project_id, workflow_definition_id, next_run_time, next_schedule_time, last_session_time, created_at, updated_at)" +
            " values (:projId, :workflowDefinitionId, :nextRunTime, :nextScheduleTime, NULL, now(), now())")
@GetGeneratedKeys
int insertSchedule(@Bind("projId") int projid, @Bind("workflowDefinitionId") long workflowDefinitionId, @Bind("nextRunTime") long nextRunTime, @Bind("nextScheduleTime") long nextScheduleTime);
 
Example 19
Source Project: digdag   Source File: DatabaseSessionStoreManager.java    License: Apache License 2.0 4 votes vote down vote up
@SqlUpdate("insert into session_attempts (session_id, site_id, project_id, attempt_name, workflow_definition_id, state_flags, timezone, params, created_at, index)" +
        " values (:sessionId, :siteId, :projectId, :attemptName, :workflowDefinitionId, :stateFlags, :timezone, :params, now(), " +
            "(select coalesce(max(index), 0) + 1 from session_attempts where session_id = :sessionId)" +
        ")")
@GetGeneratedKeys
long insertAttempt(@Bind("siteId") int siteId, @Bind("projectId") int projectId, @Bind("sessionId") long sessionId, @Bind("attemptName") String attemptName, @Bind("workflowDefinitionId") Long workflowDefinitionId, @Bind("stateFlags") int stateFlags, @Bind("timezone") String timezone, @Bind("params") Config params);
 
Example 20
Source Project: digdag   Source File: DatabaseSessionStoreManager.java    License: Apache License 2.0 4 votes vote down vote up
@SqlUpdate("insert into session_monitors (attempt_id, next_run_time, type, config, created_at, updated_at)" +
        " values (:attemptId, :nextRunTime, :type, :config, now(), now())")
@GetGeneratedKeys
long insertSessionMonitor(@Bind("attemptId") long attemptId, @Bind("nextRunTime") long nextRunTime, @Bind("type") String type, @Bind("config") Config config);
 
Example 21
Source Project: digdag   Source File: DatabaseSessionStoreManager.java    License: Apache License 2.0 4 votes vote down vote up
@SqlUpdate("insert into tasks (attempt_id, parent_id, task_type, state, state_flags, updated_at)" +
        " values (:attemptId, :parentId, :taskType, :state, :stateFlags, now())")
@GetGeneratedKeys
long insertTask(@Bind("attemptId") long attemptId, @Bind("parentId") Long parentId,
        @Bind("taskType") int taskType, @Bind("state") short state, @Bind("stateFlags") int stateFlags);
 
Example 22
Source Project: digdag   Source File: DatabaseSessionStoreManager.java    License: Apache License 2.0 4 votes vote down vote up
@SqlUpdate("insert into tasks (attempt_id, parent_id, task_type, state, state_flags, updated_at)" +
        " values (:attemptId, :parentId, :taskType, :state, :stateFlags, :updatedAt)")
@GetGeneratedKeys
long insertResumedTask(@Bind("attemptId") long attemptId, @Bind("parentId") long parentId, @Bind("taskType") int taskType, @Bind("state") int state, @Bind("stateFlags") int stateFlags, @Bind("updatedAt") java.sql.Timestamp updatedAt);
 
Example 23
Source Project: digdag   Source File: DatabaseTaskQueueServer.java    License: Apache License 2.0 4 votes vote down vote up
@SqlUpdate("insert into queued_tasks" +
        " (site_id, queue_id, unique_name, data, created_at)" +
        " values (:siteId, :queueId, :uniqueName, :data, now())")
@GetGeneratedKeys
long insertQueuedTask(@Bind("siteId") Integer siteId, @Bind("queueId") Integer queueId, @Bind("uniqueName") String uniqueName,
        @Bind("data") byte[] data);
 
Example 24
Source Project: digdag   Source File: DatabaseQueueSettingStoreManager.java    License: Apache License 2.0 4 votes vote down vote up
@SqlUpdate("insert into queue_settings" +
        " (site_id, name, config, created_at, updated_at)" +
        " values (:siteId, :name, NULL, now(), now())")
@GetGeneratedKeys
int insertDefaultQueueSetting(@Bind("siteId") int siteId, @Bind("name") String name);
 
Example 25
Source Project: quark   Source File: JdbcSourceDAO.java    License: Apache License 2.0 4 votes vote down vote up
@GetGeneratedKeys
@SqlUpdate("update jdbc_sources set username = :j.username,"
    + " password = :j.password where id = :j.id")
protected abstract int updateJdbc(@BindBean("j") JdbcSource source);
 
Example 26
Source Project: quark   Source File: QuboleDbSourceDAO.java    License: Apache License 2.0 4 votes vote down vote up
@GetGeneratedKeys
@SqlUpdate("update quboledb_sources set dbtap_id = :d.dbTapId,"
    + " auth_token = :d.authToken where id = :d.id")
protected abstract int updateQubole(@BindBean("d") QuboleDbSource db);
 
Example 27
Source Project: quark   Source File: DataSourceDAO.java    License: Apache License 2.0 4 votes vote down vote up
@GetGeneratedKeys
@SqlUpdate("insert into data_sources(name, type, url, ds_set_id, datasource_type) "
    + "values(:name, :type, :url, :ds_set_id, :datasource_type)")
protected abstract int insert(@Bind("name") String name, @Bind("type") String type,
    @Bind("url") String url, @Bind("ds_set_id") long dsSetId,
    @Bind("datasource_type") String dataSourcetype);
 
Example 28
Source Project: quark   Source File: DataSourceDAO.java    License: Apache License 2.0 4 votes vote down vote up
@GetGeneratedKeys
@SqlUpdate("update data_sources set name = :d.name,"
    + " type = :d.type, datasource_type = :d.datasourceType,"
    + " url = :d.url, ds_set_id = :d.dsSetId where id = :d.id")
public abstract int update(@BindBean("d") DataSource ds);
 
Example 29
Source Project: airpal   Source File: TableDAO.java    License: Apache License 2.0 4 votes vote down vote up
@SqlBatch(
        "INSERT INTO tables (connector_id, schema_, table_, columns) " +
        "VALUES (:connectorId, :schema, :table, :columns)")
@GetGeneratedKeys
public abstract void createTables(@RosettaBinder Iterable<Table> tables);