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

The following examples show how to use org.jdbi.v3.sqlobject.statement.SqlUpdate. 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 File: H2ResourceGroupsDao.java    From presto with 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 File: TeststepRunDAO.java    From irontest with 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 #3
Source File: ResourceGroupsDao.java    From presto with 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 File: SessionPropertiesDao.java    From presto with 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 #5
Source File: UserDefinedPropertyDAO.java    From irontest with 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 #6
Source File: PropertyExtractorDAO.java    From irontest with 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 #7
Source File: H2ResourceGroupsDao.java    From presto with 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 #8
Source File: PropertyExtractorDAO.java    From irontest with 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 #9
Source File: AssertionDAO.java    From irontest with 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 #10
Source File: TeststepRunDAO.java    From irontest with 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 #11
Source File: ChallengeMariaDBProvider.java    From Guilds with 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 #12
Source File: DataTableColumnDAO.java    From irontest with 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 #13
Source File: ArenaMariaDBProvider.java    From Guilds with 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 #14
Source File: FolderDAO.java    From irontest with 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 #15
Source File: CooldownMariaDBProvider.java    From Guilds with 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 #16
Source File: DataTableCellDAO.java    From irontest with 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 #17
Source File: ArticleDAO.java    From irontest with Apache License 2.0 4 votes vote down vote up
@SqlUpdate("CREATE TABLE IF NOT EXISTS article (id IDENTITY PRIMARY KEY, title varchar(50), " +
        "content varchar(500), created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, " +
        "updated TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP)")
void createTableIfNotExists();
 
Example #18
Source File: ArenaMariaDBProvider.java    From Guilds with MIT License 4 votes vote down vote up
@Override
@SqlUpdate("INSERT INTO <prefix>arena(id, data) VALUES (:id, :data)")
void createArena(@Define("prefix") @NotNull String prefix, @Bind("id") String id, @Bind("data") String data);
 
Example #19
Source File: SessionPropertiesDao.java    From presto with Apache License 2.0 4 votes vote down vote up
@SqlUpdate("DROP TABLE IF EXISTS " + PROPERTIES_TABLE)
void dropSessionPropertiesTable();
 
Example #20
Source File: ArticleDAO.java    From irontest with Apache License 2.0 4 votes vote down vote up
@SqlUpdate("update article set content = :content, updated = CURRENT_TIMESTAMP where title = :title")
int updateByTitle(@Bind("title") String title, @Bind("content") String content);
 
Example #21
Source File: SessionPropertiesDao.java    From presto with Apache License 2.0 4 votes vote down vote up
@SqlUpdate("DROP TABLE IF EXISTS " + CLIENT_TAGS_TABLE)
void dropSessionClientTagsTable();
 
Example #22
Source File: FolderDAO.java    From irontest with Apache License 2.0 4 votes vote down vote up
@SqlUpdate("insert into folder (name) " +
           "select 'Root' where not exists (select 1 from folder where parent_folder_id is null)")
void insertARootNodeIfNotExists();
 
Example #23
Source File: DataTableColumnDAO.java    From irontest with Apache License 2.0 4 votes vote down vote up
@SqlUpdate("update datatable_column set sequence = :newSequence, updated = CURRENT_TIMESTAMP where id = :id")
void updateSequenceById(@Bind("id") long id, @Bind("newSequence") short newSequence);
 
Example #24
Source File: ArenaMySQLProvider.java    From Guilds with MIT License 4 votes vote down vote up
@Override
@SqlUpdate("INSERT INTO <prefix>arena(id, data) VALUES (:id, :data)")
void createArena(@Define("prefix") @NotNull String prefix, @Bind("id") String id, @Bind("data") String data);
 
Example #25
Source File: ArticleDAO.java    From irontest with Apache License 2.0 4 votes vote down vote up
@SqlUpdate("update article set title = :title, content = :content, updated = CURRENT_TIMESTAMP where id = :id")
int update(@BindBean Article article);
 
Example #26
Source File: HTTPStubMappingDAO.java    From irontest with Apache License 2.0 4 votes vote down vote up
@SqlUpdate("insert into httpstubmapping (testcase_id, number) values (:testcaseId, (" +
        "select coalesce(max(number), 0) + 1 from httpstubmapping where testcase_id = :testcaseId))")
@GetGeneratedKeys
long insert(@Bind("testcaseId") long testcaseId);
 
Example #27
Source File: ArticleDAO.java    From irontest with 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 #28
Source File: CooldownMariaDBProvider.java    From Guilds with MIT License 4 votes vote down vote up
@Override
@SqlUpdate("INSERT INTO <prefix>cooldowns(id, type, owner, expiry) VALUES (:id, :type, :owner, :expiry)")
void createCooldown(@Define("prefix") @NotNull String prefix, @NotNull @Bind("id") String id, @NotNull @Bind("type") String type, @NotNull @Bind("owner") String owner, @NotNull @Bind("expiry") Timestamp expiry);
 
Example #29
Source File: FolderDAO.java    From irontest with Apache License 2.0 4 votes vote down vote up
@SqlUpdate("CREATE SEQUENCE IF NOT EXISTS folder_sequence START WITH 1 INCREMENT BY 1 NOCACHE")
void createSequenceIfNotExists();
 
Example #30
Source File: TestcaseDAO.java    From irontest with Apache License 2.0 4 votes vote down vote up
@SqlUpdate("update testcase set name = :name, description = :description, " +
        "check_http_stubs_hit_order = :checkHTTPStubsHitOrder, updated = CURRENT_TIMESTAMP where id = :id")
void update(@BindBean Testcase testcase);