org.jdbi.v3.sqlobject.statement.GetGeneratedKeys Java Examples
The following examples show how to use
org.jdbi.v3.sqlobject.statement.GetGeneratedKeys.
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: TeststepDAO.java From irontest with Apache License 2.0 | 5 votes |
@SqlUpdate("insert into teststep (testcase_id, sequence, name, type, description, action, request, request_type, " + "request_filename, api_request, endpoint_id, endpoint_property, other_properties) values (:t.testcaseId, " + "select coalesce(max(sequence), 0) + 1 from teststep where testcase_id = :t.testcaseId, :t.name, " + ":t.type, :t.description, :t.action, :request, :requestType, :t.requestFilename, :apiRequest, " + ":endpointId, :t.endpointProperty, :t.otherProperties)") @GetGeneratedKeys long _insertWithName(@BindBean("t") Teststep teststep, @Bind("request") byte[] request, @Bind("requestType") String requestType, @Bind("apiRequest") String apiRequest, @Bind("endpointId") Long endpointId);
Example #2
Source File: TestcaseRunDAO.java From irontest with Apache License 2.0 | 5 votes |
@SqlUpdate("insert into testcase_run " + "(testcase_id, testcase_name, testcase_folderpath, starttime, duration, result) values " + "(:testcase_id, :testcase_name, :testcase_folderpath, :starttime, :duration, :result)") @GetGeneratedKeys long _insert(@Bind("testcase_id") long testcaseId, @Bind("testcase_name") String testcaseName, @Bind("testcase_folderpath") String testcaseFolderPath, @Bind("starttime") Date startTime, @Bind("duration") long duration, @Bind("result") String result);
Example #3
Source File: TeststepRunDAO.java From irontest with Apache License 2.0 | 5 votes |
@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 #4
Source File: TeststepDAO.java From irontest with Apache License 2.0 | 5 votes |
/** * This method considers test step insertion from both Create (test step) button on UI and test case duplicating. * @param teststep * @param request * @param endpointId * @return */ @SqlUpdate("insert into teststep (testcase_id, sequence, type, request, api_request, endpoint_id, " + "other_properties) values (:t.testcaseId, " + "(select coalesce(max(sequence), 0) + 1 from teststep where testcase_id = :t.testcaseId), " + ":t.type, :request, :apiRequest, :endpointId, :t.otherProperties)") @GetGeneratedKeys long _insertWithoutName(@BindBean("t") Teststep teststep, @Bind("request") Object request, @Bind("endpointId") Long endpointId, @Bind("apiRequest") String apiRequest);
Example #5
Source File: EndpointDAO.java From irontest with Apache License 2.0 | 5 votes |
/** * Duplicate the endpoint of the specified test step if the endpoint exists and is an unmanaged one. * @param oldTeststepId * @return new endpoint id if one endpoint is duplicated; null otherwise. */ @SqlUpdate("insert into endpoint (name, type, description, url, username, password, other_properties) " + "select e.name, e.type, e.description, e.url, e.username, e.password, e.other_properties " + "from teststep t left outer join endpoint e on t.endpoint_id = e.id where t.id = :oldTeststepId " + "and e.id is not null and e.environment_id is null") @GetGeneratedKeys Long duplicateUnmanagedEndpoint(@Bind("oldTeststepId") long oldTeststepId);
Example #6
Source File: CarModelDao.java From tutorials with MIT License | 4 votes |
@SqlBatch("insert") @GetGeneratedKeys List<Long> bulkInsert(@BindBean List<CarModel> models);
Example #7
Source File: CarModelDao.java From tutorials with MIT License | 4 votes |
@SqlUpdate("insert") @GetGeneratedKeys Long insert(@BindBean CarModel carModel);
Example #8
Source File: TeamSqlObject.java From jdit with MIT License | 4 votes |
@SqlUpdate("insert into teams(name, division) values (:name, :division)") @GetGeneratedKeys long createTeam(@Bind("name") String name, @Bind("division") Division division);
Example #9
Source File: PlayerSqlObject.java From jdit with MIT License | 4 votes |
@GetGeneratedKeys @SqlUpdate("insert into players(first_name, last_name, birth_date, weight, height) values" + "(:first_name, :last_name, :birth_date, :weight, :height)") Long createPlayer(@PlayerBinder Player player);
Example #10
Source File: CarMakerDao.java From tutorials with MIT License | 4 votes |
@SqlUpdate @GetGeneratedKeys Long insert(@BindBean CarMaker carMaker);
Example #11
Source File: TestcaseDAO.java From irontest with Apache License 2.0 | 4 votes |
@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 #12
Source File: PlayerSqlObject.java From jdit with MIT License | 4 votes |
@GetGeneratedKeys @SqlUpdate("insert into players(first_name, last_name, birth_date, weight, height) values" + "(:first_name, :last_name, :birth_date, :weight, :height)") Long createPlayer(@Bind("first_name") String firstName, @Bind("last_name") String lastName, @Bind("birth_date") Date birthDate, @Bind("height") int height, @Bind("weight") int weight);
Example #13
Source File: PropertyExtractorDAO.java From irontest with Apache License 2.0 | 4 votes |
@SqlUpdate("insert into property_extractor (teststep_id, property_name, type, other_properties) values " + "(:teststepId, :p.propertyName, :p.type, :p.otherProperties)") @GetGeneratedKeys long insert(@Bind("teststepId") long teststepId, @BindBean("p") PropertyExtractor propertyExtractor);
Example #14
Source File: HTTPStubMappingDAO.java From irontest with Apache License 2.0 | 4 votes |
@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 #15
Source File: UserDefinedPropertyDAO.java From irontest with Apache License 2.0 | 4 votes |
@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 #16
Source File: UserDefinedPropertyDAO.java From irontest with Apache License 2.0 | 4 votes |
@SqlUpdate("insert into udp (testcase_id, sequence) values (:testcaseId, (" + "select coalesce(max(sequence), 0) + 1 from udp where testcase_id = :testcaseId))") @GetGeneratedKeys long _insertWithoutName(@Bind("testcaseId") long testcaseId);
Example #17
Source File: ArticleDAO.java From irontest with Apache License 2.0 | 4 votes |
@SqlUpdate("insert into article (title, content) values (:title, :content)") @GetGeneratedKeys long insert(@BindBean Article article);
Example #18
Source File: CarMakerDao.java From tutorials with MIT License | 4 votes |
@SqlBatch("insert") @GetGeneratedKeys List<Long> bulkInsert(@BindBean List<CarMaker> carMakers);
Example #19
Source File: TestcaseDAO.java From irontest with Apache License 2.0 | 4 votes |
@SqlUpdate("insert into testcase (name, description, parent_folder_id, check_http_stubs_hit_order) " + "select :name, description, :parentFolderId, check_http_stubs_hit_order from testcase where id = :sourceTestcaseId") @GetGeneratedKeys long duplicateById(@Bind("name") String name, @Bind("parentFolderId") long parentFolderId, @Bind("sourceTestcaseId") long sourceTestcaseId);
Example #20
Source File: EndpointDAO.java From irontest with Apache License 2.0 | 4 votes |
@SqlUpdate("insert into endpoint (environment_id, type, other_properties) values (:evId, :ep.type, :ep.otherProperties)") @GetGeneratedKeys long _insertManagedEndpoint(@BindBean("ep") Endpoint endpoint, @Bind("evId") long environmentId);
Example #21
Source File: TestcaseDAO.java From irontest with Apache License 2.0 | 4 votes |
@SqlUpdate("insert into testcase (description, parent_folder_id) values (:description, :parentFolderId)") @GetGeneratedKeys long _insertWithoutName(@BindBean Testcase testcase);
Example #22
Source File: DataTableColumnDAO.java From irontest with Apache License 2.0 | 4 votes |
@SqlUpdate("insert into datatable_column (type, sequence, testcase_id) values (:type, " + "select max(sequence) + 1 from datatable_column where testcase_id = :testcaseId, :testcaseId)") @GetGeneratedKeys long _insert(@Bind("testcaseId") long testcaseId, @Bind("type") String type);
Example #23
Source File: DataTableColumnDAO.java From irontest with Apache License 2.0 | 4 votes |
@SqlUpdate("insert into datatable_column (name, type, sequence, testcase_id) values (:name, :type, " + "select coalesce(max(sequence), 0) + 1 from datatable_column where testcase_id = :testcaseId, :testcaseId)") @GetGeneratedKeys long insert(@Bind("testcaseId") long testcaseId, @Bind("name") String name, @Bind("type") String type);
Example #24
Source File: TeststepDAO.java From irontest with Apache License 2.0 | 4 votes |
@SqlUpdate("insert into teststep (testcase_id, sequence, name, type, description, action, request, request_type, " + "request_filename, api_request, endpoint_id, endpoint_property, other_properties) select :newTestcaseId, " + "sequence, name, type, description, action, request, request_type, request_filename, api_request, " + "endpoint_id, endpoint_property, other_properties from teststep where id = :oldTeststepId") @GetGeneratedKeys long duplicateById(@Bind("oldTeststepId") long oldTeststepId, @Bind("newTestcaseId") long newTestcaseId);
Example #25
Source File: AssertionDAO.java From irontest with Apache License 2.0 | 4 votes |
@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 #26
Source File: TestcaseIndividualRunDAO.java From irontest with Apache License 2.0 | 4 votes |
@SqlUpdate("insert into testcase_individualrun (testcase_run_id, caption, starttime, duration, result) values (" + ":testcaseRunId, :caption, :startTime, :duration, :result)") @GetGeneratedKeys long _insert(@Bind("testcaseRunId") long testcaseRunId, @Bind("caption") String caption, @Bind("startTime") Date startTime, @Bind("duration") long duration, @Bind("result") String result);
Example #27
Source File: EnvironmentDAO.java From irontest with Apache License 2.0 | 4 votes |
@SqlUpdate("insert into environment values ()") @GetGeneratedKeys long _insert();
Example #28
Source File: UserDAO.java From irontest with Apache License 2.0 | 4 votes |
@SqlUpdate("insert into user (username, password, salt) values (:username, :password, :salt)") @GetGeneratedKeys long _insert(@Bind("username") String username, @Bind("password") String password, @Bind("salt") String salt);
Example #29
Source File: FolderDAO.java From irontest with Apache License 2.0 | 4 votes |
@SqlUpdate("insert into folder (parent_folder_id) values (:parentFolderId)") @GetGeneratedKeys long _insert(@Bind("parentFolderId") long parentFolderId);
Example #30
Source File: DataTableColumnDAO.java From irontest with Apache License 2.0 | 2 votes |
/** * @param testcaseId * @param column * @param type for enum, name instead of value is bound by JDBI, so use a separate @Bind here instead of taking advantage of the @BindBean. * @return */ @SqlUpdate("insert into datatable_column (name, type, sequence, testcase_id) values (:c.name, :type, " + ":c.sequence, :testcaseId)") @GetGeneratedKeys long insert(@Bind("testcaseId") long testcaseId, @BindBean("c") DataTableColumn column, @Bind("type") String type);