November 2018
Beginner to intermediate
260 pages
6h 12m
English
In our example, we have a primitive integer as a key and the Conference class as value. In the persistence settings .xml file, the keyPersistence node represents the key of our cache. A key can be a concrete object, but in our case the key is just an integer. Therefore, we'll set the id as key in keyPersistence. We are using the POJO strategy, so we won't set the column attribute for the valuePersistence node. The <field > markup node is used to map the Java members to Cassandra columns.
<persistence keyspace="persistence" table="conference"> <keyPersistence class="java.lang.Integer" strategy="PRIMITIVE" ...
Read now
Unlock full access