I am saving a Document in the Couchbase using Spring. For some fields extra information is added.
POJO:
@Document public class PlayerTxn implements Serializable {
private static final long serialVersionUID = -2569497126561L;
@Id private String id;
@Field private Date txnDate;
@Field private BigDecimal wagerAmount;
@Field private BigDecimal pointsAwarded;
@Field private String segment;
RequiredResult:
{ "txnDate": 234234234324, "wagerAmount": 234.33, "pointsAwarded":
23.2, "segment": "xxx" }
End result:
{ "_class": "com.app.model.PlayerTxn", "segment":
"xxx", "wagerAmount": {
"intCompact": 24312,
"scale": 2,
"precision": 5,
"stringCache": "243.12" }, "pointsAwarded": {
"intCompact": -9223372036854776000,
"scale": 38,
"precision": 0,
"intVal": {
"signum": 1,
"bitCount": 0,
"mag": [
3800,
-457875904,
-1778440383,
-1805069212,
295579091
],
"lowestSetBit": 0,
"firstNonzeroIntNum": 0,
"bitLength": 0
} }, "txnDate": 1466417747057 }
Had to write a customConverter for BigDecimal.
But still "_class" is being added in the Document. Any idea how can I remove it?