Regarding datastax cassandra object mapper, reading the manual, it seems that the mapper interface only allow single entity query. I’ll have to provide the whole primary keys for the mapper. In many cases, I need to query the database to get more than one row. For that, I can use the accessor.Then I don’t even need an object mapper at all.
Another option is that I could use prepared statements.
It seems to me that the mapper is quite limited in functionality if my understanding is correct. Why would I want to go through the trouble to create an object mapper (and maintain it) if I can just use the accessor to perform simple and complex queries?
EDIT
I just came across this good answer on another question. It shows that we can use the mapper to map ResultSet
's that is returned by complex queries. This is useful to remove boiler plate code, which corroborates what @Alex Ott said.
Quite often you need to read one entry based on the value of the primary key, and transform it into "business" object. Or you want to save or remove data. That's are the cases where mapper makes life easier.