Java Code Examples for org.jdbi.v3.sqlobject.customizer.BindBean

The following examples show how to use org.jdbi.v3.sqlobject.customizer.BindBean. 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: irontest   Source File: EndpointDAO.java    License: Apache License 2.0 5 votes vote down vote up
@SqlUpdate("update endpoint set environment_id = :evId, name = :ep.name, type = :ep.type, " +
        "description = :ep.description, url = :ep.url, username = :ep.username, password = CASE " +
            "WHEN COALESCE(password, '') <> COALESCE(:ep.password, '') " + // encrypt only when password is changed
                "THEN ENCRYPT('AES', '" + ENDPOINT_PASSWORD_ENCRYPTION_KEY + "', STRINGTOUTF8(:ep.password)) " +
            "ELSE password END, " +
        "other_properties = :ep.otherProperties, updated = CURRENT_TIMESTAMP where id = :ep.id")
void _update(@BindBean("ep") Endpoint endpoint, @Bind("evId") Long environmentId);
 
Example 2
Source Project: irontest   Source File: TeststepDAO.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * 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 3
Source Project: irontest   Source File: TeststepDAO.java    License: Apache License 2.0 5 votes vote down vote up
@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 4
Source Project: irontest   Source File: TeststepDAO.java    License: Apache License 2.0 5 votes vote down vote up
@SqlUpdate("update teststep set name = :t.name, description = :t.description, action = :t.action, request = :request, " +
        "request_type = :requestType, request_filename = :t.requestFilename, api_request = :apiRequest, " +
        "endpoint_id = :endpointId, endpoint_property = :t.endpointProperty, other_properties = :t.otherProperties, " +
        "updated = CURRENT_TIMESTAMP where id = :t.id")
void _updateWithStringRequest(@BindBean("t") Teststep teststep, @Bind("request") Object request,
                              @Bind("requestType") String requestType,
                              @Bind("apiRequest") String apiRequest,
                              @Bind("endpointId") Long endpointId);
 
Example 5
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 6
@SqlUpdate("INSERT INTO book(id, title) VALUES (:id, :title)")
void insertBook(@BindBean Book book);
 
Example 7
Source Project: irontest   Source File: DataTableCellDAO.java    License: Apache License 2.0 4 votes vote down vote up
@SqlUpdate("update datatable_cell set value = :cell.value, endpoint_id = :endpointId, updated = CURRENT_TIMESTAMP " +
        "where id = :cell.id")
void update(@BindBean("cell") DataTableCell cell, @Bind("endpointId") Long endpointId);
 
Example 8
Source Project: irontest   Source File: DataTableCellDAO.java    License: Apache License 2.0 4 votes vote down vote up
@SqlUpdate("insert into datatable_cell (column_id, row_sequence, value, endpoint_id) values (:columnId, " +
        ":cell.rowSequence, :cell.value, :endpointId)")
void _insert(@Bind("columnId") long columnId, @BindBean("cell") DataTableCell cell, @Bind("endpointId") Long endpointId);
 
Example 9
Source Project: irontest   Source File: EndpointDAO.java    License: Apache License 2.0 4 votes vote down vote up
@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 10
Source Project: irontest   Source File: FolderDAO.java    License: Apache License 2.0 4 votes vote down vote up
@SqlUpdate("update folder set name = :name, description = :description, " +
        "updated = CURRENT_TIMESTAMP where id = :id")
void update(@BindBean Folder folder);
 
Example 11
Source Project: irontest   Source File: EnvironmentDAO.java    License: Apache License 2.0 4 votes vote down vote up
@SqlUpdate("update environment set name = :name, description = :description, updated = CURRENT_TIMESTAMP where id = :id")
void update(@BindBean Environment environment);
 
Example 12
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 13
Source Project: irontest   Source File: AssertionDAO.java    License: Apache License 2.0 4 votes vote down vote up
@SqlUpdate("update assertion set name = :a.name, other_properties = :a.otherProperties, " +
        "updated = CURRENT_TIMESTAMP where id = :a.id")
void update(@BindBean("a") Assertion assertion);
 
Example 14
Source Project: irontest   Source File: TeststepDAO.java    License: Apache License 2.0 4 votes vote down vote up
@SqlUpdate("update teststep set name = :t.name, description = :t.description, request_type = :requestType, " +
        "request_filename = :t.requestFilename, action = :t.action, endpoint_id = :endpointId, " +
        "endpoint_property = :t.endpointProperty, other_properties = :t.otherProperties, updated = CURRENT_TIMESTAMP " +
        "where id = :t.id")
void _updateWithoutRequest(@BindBean("t") Teststep teststep, @Bind("requestType") String requestType,
                           @Bind("endpointId") Long endpointId);
 
Example 15
Source Project: irontest   Source File: TestcaseDAO.java    License: Apache License 2.0 4 votes vote down vote up
@SqlUpdate("insert into testcase (description, parent_folder_id) values (:description, :parentFolderId)")
@GetGeneratedKeys
long _insertWithoutName(@BindBean Testcase testcase);
 
Example 16
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 17
Source Project: irontest   Source File: TestcaseDAO.java    License: 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);
 
Example 18
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 19
Source Project: irontest   Source File: ArticleDAO.java    License: 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 20
Source Project: irontest   Source File: UserDefinedPropertyDAO.java    License: Apache License 2.0 4 votes vote down vote up
@SqlUpdate("update udp set name = :name, value = :value, updated = CURRENT_TIMESTAMP where id = :id")
void update(@BindBean UserDefinedProperty udp);
 
Example 21
Source Project: irontest   Source File: PropertyExtractorDAO.java    License: Apache License 2.0 4 votes vote down vote up
@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 22
@SqlBatch("update world set randomNumber = :p.randomNumber where id = :p.id")
@Transaction
void update(@BindBean("p") World...worlds);
 
Example 23
Source Project: tutorials   Source File: CarModelDao.java    License: MIT License 4 votes vote down vote up
@SqlUpdate("insert")
@GetGeneratedKeys
Long insert(@BindBean CarModel carModel);
 
Example 24
Source Project: tutorials   Source File: CarModelDao.java    License: MIT License 4 votes vote down vote up
@SqlBatch("insert")
@GetGeneratedKeys
List<Long> bulkInsert(@BindBean List<CarModel> models);
 
Example 25
Source Project: tutorials   Source File: CarMakerDao.java    License: MIT License 4 votes vote down vote up
@SqlUpdate
@GetGeneratedKeys
Long insert(@BindBean CarMaker carMaker);
 
Example 26
Source Project: tutorials   Source File: CarMakerDao.java    License: MIT License 4 votes vote down vote up
@SqlBatch("insert")
@GetGeneratedKeys
List<Long> bulkInsert(@BindBean List<CarMaker> carMakers);
 
Example 27
Source Project: irontest   Source File: EndpointDAO.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Here assuming endpoint.password is already encrypted.
 * @param endpoint
 * @return
 */
@SqlUpdate("insert into endpoint (name, type, description, url, username, password, other_properties) " +
           "values (:ep.name, :ep.type, :ep.description, :ep.url, :ep.username, :ep.password, :ep.otherProperties)")
@GetGeneratedKeys
long insertUnmanagedEndpoint(@BindBean("ep") Endpoint endpoint);
 
Example 28
Source Project: irontest   Source File: DataTableColumnDAO.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * @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);