Uploaded image for project: 'Spring Data for Apache Cassandra'
  1. Spring Data for Apache Cassandra
  2. DATACASS-556

CqlTemplate should use PreparedStatements for DataStax Statement

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 2.0.7 (Kay SR7)
    • Fix Version/s: None
    • Component/s: Core
    • Labels:
      None

      Description

      Currently the CqlTemplate allows the user to create a PreparedStatement through methods like

      public <T> T query(PreparedStatementCreator preparedStatementCreator, ResultSetExtractor<T> resultSetExtractor)
      

      In addition, execute and query methods on the CqlTemplate with a vararg parameter will have a PreparedStatement created automatically. An example of this is

      public <T> T query(String cql, ResultSetExtractor<T> resultSetExtractor, Object... args) 
      

      A useful addition, would be adding execute and query methods to the CqlTemplate that use the Statement with vararg parameter. These methods could also create a PreparedStatement automatically.

      An example might be:

      public <T> List<T> query(RegularStatement regStatement, RowMapper<T> rowMapper, Object... args)
      

      A partial PR shows how this might look. 
      Some more work can be done if this is approved

       

        Attachments

          Activity

            People

            Assignee:
            mp911de Mark Paluch
            Reporter:
            codesmell Mike Barlotta
            Last updater:
            Mike Barlotta
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              2 years, 9 weeks, 5 days ago