Skip to content

SimpleJdbcTestUtils: Query table row [SPR-4545] #9222

@spring-projects-issues

Description

@spring-projects-issues

Paul Benedict opened SPR-4545 and commented

My Hibernate integration tests follow a typical pattern: save entity through session, flush session, JDBC select rows from table matching persisted identifiers. I use JDBC to verify my Hibernate mappings.

I'd like to propose a new method that queries a table passing one or multiple parameters:
SimpleJdbcTestUtils.queryRow(String tableName, String keyName, Object keyValue);
SimpleJdbcTestUtils.queryRow(String tableName, Map keys);

which would translate to:
SELECT * FROM {tableName} WHERE {keyName} = {keyValue} respectively.

If you can dream up better semantics, please do.


Affects: 2.5.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: coreIssues in core modules (aop, beans, core, context, expression)status: declinedA suggestion or change that we don't feel we should currently applytype: enhancementA general enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions