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
Assignees
Labels
in: core Issues in core support type: bug A general bug

Comments

@spring-projects-issues
Copy link

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

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
Labels
in: core Issues in core support type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants