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.appendIdCriteria throws NullPointerException when using MapId containing unknown property names [DATACASS-308] #478

Closed
spring-projects-issues opened this issue Jun 30, 2016 · 1 comment

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented Jun 30, 2016

Mark Paluch opened DATACASS-308 and commented

CassandraTemplate.appendIdCriteria throws NullPointerException when using it together with a MapId but only if the map keys are different from the property names in the given entity.

Code to reproduce:

@Table("user_tokens")
public class UserToken {
	
	@PrimaryKeyColumn(name = "the_user_id", type = PrimaryKeyType.PARTITIONED,
			ordinal = 0) @CassandraType(type = Name.UUID) private UUID userId;
}

template.selectOneById(UserToken.class, BasicMapId.id("the_user_id", userToken.getUserId()));

leads to:

java.lang.NullPointerException
	at org.springframework.data.cassandra.core.CassandraTemplate.appendIdCriteria(CassandraTemplate.java:425)
	at org.springframework.data.cassandra.core.CassandraTemplate.appendIdCriteria(CassandraTemplate.java:433)
	at org.springframework.data.cassandra.core.CassandraTemplate.appendIdCriteria(CassandraTemplate.java:466)
	at org.springframework.data.cassandra.core.CassandraTemplate.selectOneById(CassandraTemplate.java:410)

Affects: 1.3.4 (Gosling SR4)

Referenced from: pull request #73

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Jul 1, 2016

John Blum commented

PR #73 merged. Thank you!

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
2 participants