Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CassandraTemplate @PrimaryKeyColumn annotation, name property, not working on delete [DATACASS-142] #319

Closed
spring-projects-issues opened this issue Jul 27, 2014 · 3 comments

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented Jul 27, 2014

barak cohen opened DATACASS-142 and commented

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;]


Affects: 1.0 GA (Dijkstra), 1.1 M1 (Evans)

Attachments:

Referenced from: commits 2a921b4, 1f7cbc4, 60f6c8f, 347af3e, 5fe72e3, 8a64f91

0 votes, 5 watchers

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Sep 12, 2014

Matthew T. Adams commented

This is fixed in branches master, 1.1.x, & 1.0.x. This issue's "Fix Version(s)" will be updated as soon as version "1.1.1 (Evans SR1)" is added

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Feb 2, 2016

Raja Jain commented

I am still getting the same issue.It's taking variable name instead of column name (name mentioned in annotation PrimaryKeyColumn)
Following is the version i am using :
org.springframework.data:spring-data-cassandra:1.3.2.RELEASE

or please suggest,on which version delete is working fine

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Jun 2, 2018

Abhishek SIngh commented

Hey All, I am working with Spring data 1.4.3 and still able to reproduce this bug 

Below is the DELETE stmt from debugging

DELETE FROM due_event WHERE studentId=*** AND batchNo=*** AND dayAndHour=**** AND courseId='' AND assignmentId='' AND assessmentId='**';

 

CREATE TABLE if not exists due_event (
bucket timestamp,
batch_no int,
due_date timestamp, 
course_id text, 
assignment_id text,
assessment_id text,
student_id text,
PRIMARY KEY ((bucket,batch_no),course_id,assignment_id,assessment_id,student_id)
);

Refer to DS-142.txt  for stack trace

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant