我已经编写了一个扩展CassandsraRepository的Repository。与SQL Spring Data Repository功能不同,SDC不会返回插入记录的POJO。例如,我插入一个user_id和name,存储库函数不会返回Obj(" ID"," Name")。这是某些特定于Cassandra还是我错过了什么?
我正在使用SDC版本1.5.0RC1
答案 0 :(得分:1)
如果使用CassandraTemplate中的insert()方法,则该方法不会返回持久化实体,而是返回传递给insert方法的实体。
根据API,如果您使用CassandraRepository save()方法,您将返回实际的持久化实体
save
<S extends T> S save(S entity)
Saves a given entity. Use the returned instance for further operations as the save operation might have changed the entity instance completely.
Parameters:
entity -
Returns:
the saved entity