Java Code Examples for org.jdbi.v3.sqlobject.statement.SqlUpdate

The following examples show how to use org.jdbi.v3.sqlobject.statement.SqlUpdate. 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: H2ResourceGroupsDao.java    License: Apache License 2.0 6 votes vote down vote up
@SqlUpdate("INSERT INTO resource_groups\n" +
        "(resource_group_id, name, soft_memory_limit, max_queued, soft_concurrency_limit, hard_concurrency_limit, scheduling_policy, scheduling_weight, jmx_export, soft_cpu_limit, hard_cpu_limit, parent, environment)\n" +
        "VALUES (:resource_group_id, :name, :soft_memory_limit, :max_queued, :soft_concurrency_limit, :hard_concurrency_limit, :scheduling_policy, :scheduling_weight, :jmx_export, :soft_cpu_limit, :hard_cpu_limit, :parent, :environment)")
void insertResourceGroup(
        @Bind("resource_group_id") long resourceGroupId,
        @Bind("name") String name,
        @Bind("soft_memory_limit") String softMemoryLimit,
        @Bind("max_queued") int maxQueued,
        @Bind("soft_concurrency_limit") Integer softConcurrencyLimit,
        @Bind("hard_concurrency_limit") int hardConcurrencyLimit,
        @Bind("scheduling_policy") String schedulingPolicy,
        @Bind("scheduling_weight") Integer schedulingWeight,
        @Bind("jmx_export") Boolean jmxExport,
        @Bind("soft_cpu_limit") String softCpuLimit,
        @Bind("hard_cpu_limit") String hardCpuLimit,
        @Bind("parent") Long parent,
        @Bind("environment") String environment);
 
Example 2
Source Project: presto   Source File: SessionPropertiesDao.java    License: Apache License 2.0 5 votes vote down vote up
@VisibleForTesting
@SqlUpdate("INSERT INTO " + PROPERTIES_TABLE + " (property_spec_id, session_property_name, session_property_value)\n" +
        "VALUES (:property_spec_id, :session_property_name, :session_property_value)")
void insertSessionProperty(
        @Bind("property_spec_id") long propertySpecId,
        @Bind("session_property_name") String sessionPropertyName,
        @Bind("session_property_value") String sessionPropertyValue);
 
Example 3
Source Project: presto   Source File: ResourceGroupsDao.java    License: Apache License 2.0 5 votes vote down vote up
@SqlUpdate("CREATE TABLE IF NOT EXISTS selectors (\n" +
        "  resource_group_id BIGINT NOT NULL,\n" +
        "  priority BIGINT NOT NULL,\n" +
        "  user_regex VARCHAR(512),\n" +
        "  source_regex VARCHAR(512),\n" +
        "  query_type VARCHAR(512),\n" +
        "  client_tags VARCHAR(512),\n" +
        "  selector_resource_estimate VARCHAR(1024),\n" +
        "  FOREIGN KEY (resource_group_id) REFERENCES resource_groups (resource_group_id)\n" +
        ")")
void createSelectorsTable();
 
Example 4
Source Project: irontest   Source File: PropertyExtractorDAO.java    License: Apache License 2.0 5 votes vote down vote up
@SqlUpdate("update property_extractor set property_name = :propertyName, other_properties = :otherProperties, " +
        "updated = CURRENT_TIMESTAMP where id = :id")
void update(@BindBean PropertyExtractor propertyExtractor);
 
Example 5
Source Project: presto   Source File: H2ResourceGroupsDao.java    License: Apache License 2.0 5 votes vote down vote up
@SqlUpdate("DELETE FROM selectors WHERE resource_group_id = :resource_group_id\n" +
        " AND ((user_regex IS NULL AND :user_regex IS NULL) OR user_regex = :user_regex)\n" +
        " AND ((source_regex IS NULL AND :source_regex IS NULL) OR source_regex = :source_regex)\n" +
        " AND ((client_tags IS NULL AND :client_tags IS NULL) OR client_tags = :client_tags)")
void deleteSelector(
        @Bind("resource_group_id") long resourceGroupId,
        @Bind("user_regex") String userRegex,
        @Bind("source_regex") String sourceRegex,
        @Bind("client_tags") String clientTags);
 
Example 6
Source Project: irontest   Source File: PropertyExtractorDAO.java    License: Apache License 2.0 5 votes vote down vote up
@SqlUpdate("CREATE TABLE IF NOT EXISTS property_extractor (" +
        "id BIGINT DEFAULT property_extractor_sequence.NEXTVAL PRIMARY KEY, teststep_id BIGINT NOT NULL, " +
        "property_name VARCHAR(200) NOT NULL, type VARCHAR(50) NOT NULL, other_properties CLOB," +
        "created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, " +
        "updated TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, " +
        "FOREIGN KEY (teststep_id) REFERENCES teststep(id) ON DELETE CASCADE, " +
        "CONSTRAINT PROPERTY_EXTRACTOR_" + DB_UNIQUE_NAME_CONSTRAINT_NAME_SUFFIX + " UNIQUE(teststep_id, property_name), " +
        "CONSTRAINT PROPERTY_EXTRACTOR_" + DB_PROPERTY_NAME_CONSTRAINT_NAME_SUFFIX + " CHECK(" + CUSTOM_PROPERTY_NAME_CHECK2 + "))")
void createTableIfNotExists();
 
Example 7
Source Project: irontest   Source File: AssertionDAO.java    License: Apache License 2.0 5 votes vote down vote up
@SqlUpdate("CREATE TABLE IF NOT EXISTS assertion (" +
        "id BIGINT DEFAULT assertion_sequence.NEXTVAL PRIMARY KEY, teststep_id BIGINT NOT NULL, " +
        "name VARCHAR(200) NOT NULL, type VARCHAR(50) NOT NULL, other_properties CLOB NOT NULL," +
        "created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, " +
        "updated TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, " +
        "FOREIGN KEY (teststep_id) REFERENCES teststep(id) ON DELETE CASCADE, " +
        "CONSTRAINT ASSERTION_" + DB_UNIQUE_NAME_CONSTRAINT_NAME_SUFFIX + " UNIQUE(teststep_id, name))")
void createTableIfNotExists();
 
Example 8
Source Project: irontest   Source File: TeststepRunDAO.java    License: Apache License 2.0 5 votes vote down vote up
@SqlUpdate("insert into teststep_run (testcase_run_id, testcase_individualrun_id, teststep, response, info_message," +
        " error_message, assertion_verifications, starttime, duration, result) values (" +
        ":testcaseRunId, :testcaseIndividualRunId, :teststep, :response, :infoMessage, :errorMessage, " +
        ":assertionVerifications, :startTime, :duration, :result)")
@GetGeneratedKeys
long _insert(@Bind("testcaseRunId") long testcaseRunId,
             @Bind("testcaseIndividualRunId") Long testcaseIndividualRunId,
             @Bind("teststep") String teststep, @Bind("response") String response,
             @Bind("infoMessage") String infoMessage, @Bind("errorMessage") String errorMessage,
             @Bind("assertionVerifications") String assertionVerifications,
             @Bind("startTime") Date startTime, @Bind("duration") long duration,
             @Bind("result") String result);
 
Example 9
Source Project: Guilds   Source File: ChallengeMariaDBProvider.java    License: MIT License 5 votes vote down vote up
@Override
@SqlUpdate(
        "CREATE TABLE IF NOT EXISTS <prefix>challenge (\n" +
                "  `id` VARCHAR(36) NOT NULL,\n" +
                "  `data` JSON NOT NULL,\n" +
                "  PRIMARY KEY (`id`),\n" +
                "  UNIQUE (`id`));"
)
void createContainer(@Define("prefix") @NotNull String prefix);
 
Example 10
Source Project: irontest   Source File: UserDefinedPropertyDAO.java    License: Apache License 2.0 5 votes vote down vote up
@SqlUpdate("CREATE TABLE IF NOT EXISTS udp (" +
        "id BIGINT DEFAULT udp_sequence.NEXTVAL PRIMARY KEY, testcase_id BIGINT, sequence SMALLINT NOT NULL, " +
        "name VARCHAR(200) NOT NULL DEFAULT 'P' || DATEDIFF('MS', '1970-01-01', CURRENT_TIMESTAMP), " +
        "value CLOB NOT NULL DEFAULT '', created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, " +
        "updated TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, " +
        "FOREIGN KEY (testcase_id) REFERENCES testcase(id) ON DELETE CASCADE, " +
        "CONSTRAINT UDP_UNIQUE_SEQUENCE_CONSTRAINT UNIQUE(testcase_id, sequence), " +
        "CONSTRAINT UDP_" + DB_UNIQUE_NAME_CONSTRAINT_NAME_SUFFIX + " UNIQUE(testcase_id, name), " +
        "CONSTRAINT UDP_" + DB_PROPERTY_NAME_CONSTRAINT_NAME_SUFFIX + " CHECK(" + CUSTOM_PROPERTY_NAME_CHECK + "))")
void createTableIfNotExists();
 
Example 11
Source Project: irontest   Source File: DataTableColumnDAO.java    License: Apache License 2.0 5 votes vote down vote up
@SqlUpdate("CREATE TABLE IF NOT EXISTS datatable_column (" +
        "id BIGINT DEFAULT datatable_column_sequence.NEXTVAL PRIMARY KEY, " +
        "name VARCHAR(200) NOT NULL DEFAULT 'COL' || DATEDIFF('MS', '1970-01-01', CURRENT_TIMESTAMP), " +
        "type VARCHAR(50) NOT NULL, sequence SMALLINT NOT NULL, testcase_id BIGINT NOT NULL, " +
        "created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, " +
        "updated TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, " +
        "FOREIGN KEY (testcase_id) REFERENCES testcase(id) ON DELETE CASCADE, " +
        "CONSTRAINT DATATABLE_COLUMN_CAPTION_COLUMN_UNRENAMEABLE_CONSTRAINT CHECK(NOT(sequence = 1 AND name <> 'Caption')), " +
        "CONSTRAINT DATATABLE_COLUMN_UNIQUE_SEQUENCE_CONSTRAINT UNIQUE(testcase_id, sequence), " +
        "CONSTRAINT DATATABLE_COLUMN_" + DB_UNIQUE_NAME_CONSTRAINT_NAME_SUFFIX + " UNIQUE(testcase_id, name), " +
        "CONSTRAINT DATATABLE_COLUMN_" + DB_PROPERTY_NAME_CONSTRAINT_NAME_SUFFIX + " CHECK(" +
            CUSTOM_PROPERTY_NAME_CHECK + "))")
void createTableIfNotExists();
 
Example 12
Source Project: Guilds   Source File: ArenaMariaDBProvider.java    License: MIT License 5 votes vote down vote up
@Override
@SqlUpdate(
        "CREATE TABLE IF NOT EXISTS <prefix>arena (\n" +
                "  `id` VARCHAR(36) NOT NULL,\n" +
                "  `data` JSON NOT NULL,\n" +
                "  PRIMARY KEY (`id`),\n" +
                "  UNIQUE (`id`));"
)
void createContainer(@Define("prefix") @NotNull String prefix);
 
Example 13
Source Project: irontest   Source File: FolderDAO.java    License: Apache License 2.0 5 votes vote down vote up
@SqlUpdate("CREATE TABLE IF NOT EXISTS folder (" +
        "id BIGINT DEFAULT folder_sequence.NEXTVAL PRIMARY KEY, " +
        "name varchar(200) NOT NULL DEFAULT CURRENT_TIMESTAMP, description CLOB, parent_folder_id BIGINT, " +
        "created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, " +
        "updated TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, " +
        "FOREIGN KEY (parent_folder_id) REFERENCES folder(id), " +
        "CONSTRAINT FOLDER_" + DB_UNIQUE_NAME_CONSTRAINT_NAME_SUFFIX + " UNIQUE(parent_folder_id, name))")
void createTableIfNotExists();
 
Example 14
Source Project: Guilds   Source File: CooldownMariaDBProvider.java    License: MIT License 5 votes vote down vote up
@Override
@SqlUpdate(
        "CREATE TABLE IF NOT EXISTS <prefix>cooldowns (\n" +
                "  `id` VARCHAR(36) NOT NULL,\n" +
                "  `type` VARCHAR(36) NOT NULL,\n" +
                "  `owner` VARCHAR(36) NOT NULL,\n" +
                "  `expiry` TIMESTAMP NOT NULL,\n" +
                "  PRIMARY KEY (`id`),\n" +
                "  UNIQUE (`id`));"
)
void createContainer(@Define("prefix") @NotNull String prefix);
 
Example 15
Source Project: irontest   Source File: DataTableCellDAO.java    License: Apache License 2.0 5 votes vote down vote up
@SqlUpdate("CREATE TABLE IF NOT EXISTS datatable_cell (" +
        "id BIGINT DEFAULT datatable_cell_sequence.NEXTVAL PRIMARY KEY, column_id BIGINT NOT NULL, " +
        "row_sequence SMALLINT NOT NULL, value CLOB NOT NULL DEFAULT '', endpoint_id BIGINT, " +
        "created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, " +
        "updated TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, " +
        "FOREIGN KEY (column_id) REFERENCES datatable_column(id) ON DELETE CASCADE, " +
        "FOREIGN KEY (endpoint_id) REFERENCES endpoint(id), " +
        "CONSTRAINT DATATABLE_CELL_UNIQUE_ROW_SEQUENCE_CONSTRAINT UNIQUE(column_id, row_sequence), " +
        "CONSTRAINT DATATABLE_CELL_EXCLUSIVE_TYPE_CONSTRAINT CHECK(value = '' OR endpoint_id is null))")
void createTableIfNotExists();
 
Example 16
Source Project: irontest   Source File: TeststepRunDAO.java    License: Apache License 2.0 5 votes vote down vote up
@SqlUpdate("CREATE TABLE IF NOT EXISTS teststep_run (id BIGINT DEFAULT teststep_run_sequence.NEXTVAL PRIMARY KEY, " +
        "testcase_run_id BIGINT NOT NULL, testcase_individualrun_id BIGINT, teststep CLOB NOT NULL, response CLOB, " +
        "info_message CLOB, error_message CLOB, assertion_verifications CLOB, " +
        "starttime TIMESTAMP NOT NULL, duration BIGINT NOT NULL, result varchar(15) NOT NULL, " +
        "created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, " +
        "updated TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, " +
        "FOREIGN KEY (testcase_run_id) REFERENCES testcase_run(id) ON DELETE CASCADE, " +
        "FOREIGN KEY (testcase_individualrun_id) REFERENCES testcase_individualrun(id) ON DELETE CASCADE)")
void createTableIfNotExists();
 
Example 17
Source Project: irontest   Source File: UserDefinedPropertyDAO.java    License: Apache License 2.0 4 votes vote down vote up
@SqlUpdate("insert into udp (testcase_id, sequence, name, value) values (:testcaseId, (" +
        "select coalesce(max(sequence), 0) + 1 from udp where testcase_id = :testcaseId), :name, :value)")
@GetGeneratedKeys
long _insertWithName(@Bind("testcaseId") long testcaseId, @Bind("name") String name, @Bind("value") String value);
 
Example 18
Source Project: irontest   Source File: TeststepRunDAO.java    License: Apache License 2.0 4 votes vote down vote up
@SqlUpdate("CREATE SEQUENCE IF NOT EXISTS teststep_run_sequence START WITH 1 INCREMENT BY 1 NOCACHE")
void createSequenceIfNotExists();
 
Example 19
Source Project: irontest   Source File: TeststepDAO.java    License: Apache License 2.0 4 votes vote down vote up
@SqlUpdate("delete from teststep where id = :id")
void _deleteById(@Bind("id") long id);
 
Example 20
Source Project: irontest   Source File: ArticleDAO.java    License: Apache License 2.0 4 votes vote down vote up
@SqlUpdate("insert into article (title, content) values (:title, :content)")
@GetGeneratedKeys
long insert(@BindBean Article article);
 
Example 21
Source Project: presto   Source File: SessionPropertiesDao.java    License: Apache License 2.0 4 votes vote down vote up
@SqlUpdate("DROP TABLE IF EXISTS " + CLIENT_TAGS_TABLE)
void dropSessionClientTagsTable();
 
Example 22
Source Project: presto   Source File: SessionPropertiesDao.java    License: Apache License 2.0 4 votes vote down vote up
@SqlUpdate("DROP TABLE IF EXISTS " + PROPERTIES_TABLE)
void dropSessionPropertiesTable();
 
Example 23
Source Project: irontest   Source File: AssertionDAO.java    License: Apache License 2.0 4 votes vote down vote up
@SqlUpdate("insert into assertion (teststep_id, name, type, other_properties) values " +
        "(:a.teststepId, :a.name, :a.type, :a.otherProperties)")
@GetGeneratedKeys
long insert(@BindBean("a") Assertion assertion);
 
Example 24
Source Project: presto   Source File: SessionPropertiesDao.java    License: Apache License 2.0 4 votes vote down vote up
@VisibleForTesting
@SqlUpdate("INSERT INTO " + CLIENT_TAGS_TABLE + " (tag_spec_id, client_tag) VALUES (:spec_id, :client_tag)")
void insertClientTag(@Bind("spec_id") long specId, @Bind("client_tag") String clientTag);
 
Example 25
Source Project: presto   Source File: ResourceGroupsDao.java    License: Apache License 2.0 4 votes vote down vote up
@SqlUpdate("CREATE TABLE IF NOT EXISTS resource_groups_global_properties (\n" +
        "  name VARCHAR(128) NOT NULL PRIMARY KEY,\n" +
        "  value VARCHAR(512) NULL,\n" +
        "  CHECK (name in ('cpu_quota_period'))\n" +
        ")")
void createResourceGroupsGlobalPropertiesTable();
 
Example 26
Source Project: irontest   Source File: PropertyExtractorDAO.java    License: Apache License 2.0 4 votes vote down vote up
@SqlUpdate("CREATE SEQUENCE IF NOT EXISTS property_extractor_sequence START WITH 1 INCREMENT BY 1 NOCACHE")
void createSequenceIfNotExists();
 
Example 27
Source Project: irontest   Source File: EndpointDAO.java    License: Apache License 2.0 4 votes vote down vote up
@SqlUpdate("delete from endpoint where environment_id is null and id = :id")
void deleteUnmanagedEndpointById(@Bind("id") long id);
 
Example 28
Source Project: irontest   Source File: TestcaseIndividualRunDAO.java    License: Apache License 2.0 4 votes vote down vote up
@SqlUpdate("CREATE SEQUENCE IF NOT EXISTS testcase_individualrun_sequence START WITH 1 INCREMENT BY 1 NOCACHE")
void createSequenceIfNotExists();
 
Example 29
Source Project: irontest   Source File: TestcaseDAO.java    License: Apache License 2.0 4 votes vote down vote up
@SqlUpdate("insert into testcase (name, description, parent_folder_id, check_http_stubs_hit_order) values (" +
        ":name, :description, :parentFolderId, :checkHTTPStubsHitOrder)")
@GetGeneratedKeys
long _insertWithName(@BindBean Testcase testcase);
 
Example 30
Source Project: presto   Source File: H2ResourceGroupsDao.java    License: Apache License 2.0 4 votes vote down vote up
@SqlUpdate("DELETE FROM resource_groups WHERE resource_group_id = :resource_group_id")
void deleteResourceGroup(@Bind("resource_group_id") long resourceGroupId);