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

CassandraTemplate @PrimaryKeyColumn annotation, name property, not working on delete

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Complete
    • Affects Version/s: 1.0 GA (Dijkstra), 1.1 M1 (Evans)
    • Fix Version/s: 1.0.5 (Dijkstra SR5)
    • Component/s: None
    • Labels:
      None
    • Last commented by a User:
      true

      Description

      I am using spring-data-cassandra module.

      I have an annotated bean using the @Table annotation and a primary class using the @PrimaryKeyClass

      the primary key class has 5 primary key columns (2 partitioned and 3 clustered). 2 of my columns has the name property i.e.:

      @PrimaryKeyColumn(name="correlated_type", ordinal = 2, type= PrimaryKeyType.CLUSTERED)
      private String correlatedType;
      When using the CassandraTemplate insert operation everything is working fine but when i am using the cassandraTemplate.deleteAsynchronously(List<entities> list) the columns name are not parsed using the name property but maintain the field name (correlatedType instead of correlated_type).

      i tried using a regular delete operation for a single object and tried to use the forceQuote = true property both didn't help.

      insert log sample:
      [o.s.cassandra.core.CqlTemplate] asynchronously executing [INSERT INTO identity_correlations(type,value,"*correlated_type",ts,"correlated_value*",extra) VALUES ('Participant','p5','Visitor',4,'R3',

      {'v':'1','labels':'b,c'}

      ) USING TTL 34128000;

      delete log sample:
      [o.s.cassandra.core.CqlTemplate] asynchronously executing [BEGIN BATCH DELETE FROM identity_correlations WHERE **correlatedValue**='p5' AND **correlatedType**='Participant' AND type='Visit' AND value='v1' AND ts=1;DELETE FROM identity_correlations WHERE correlatedValue='R3' AND correlatedType='Visitor' AND type='Participant' AND value='p5' AND ts=4;DELETE FROM identity_correlations WHERE correlatedValue='R3' AND correlatedType='Visitor' AND type='Participant' AND value='p5' AND ts=3;APPLY BATCH;]

        Attachments

          Activity

            People

            Assignee:
            matthewadams Matthew T. Adams
            Reporter:
            brk3483 barak cohen
            Last updater:
            Spring Issues Spring Issues
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              1 year, 21 weeks, 2 days ago