The reason is in *"id"* field. According to the persistence descriptor, cache
key will be stored in "id" field, but at the same time User POJO class also
has such field. There are several options to fix this:

1) Specify another column mapping for Ignite cache key. For example:
*<keyPersistence class="java.util.UUID" strategy="PRIMITIVE" column="userId"
/>*

2) Specify non default column mapping for "id" field in User class. Here are
the options to do this:

   a) Mark "id" field by *@QuerySqlField* annotation and specify name which
is differ than "id". For example:  

       *@QuerySqlField(name="userId")*

   b) Manually specify columns mapping for User class in xml persistence
descriptor and make sure that "id" field is mapped to something differ that
"id". For example:
*<valuePersistence class="*****.User" strategy="POJO">
    <field name="id" column="userId"/>
    <field name="name" />
</valuePersistence>*

3) Manually specify columns mapping for User class in xml persistence
descriptor and omit "id" field - such a way "id" field from User class
simply will not be persisted into Cassandra table. Which makes sense if you
already have absolutely the same value for Ignite cache key - you don't need
to save the same value twice into two different columns. Example:   
*<valuePersistence class="*****.User" strategy="POJO">
    <field name="name" />
</valuePersistence>*



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Ignite-with-Cassandra-tp7242p7395.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Reply via email to