I have this object:
public class MerchantDetail {
private id;
private boolean optStatus;
private BigDecimal amountDue;
@ManyToOne(optional=false)
@JoinColumn(referencedColumnName="merchantId")
private Merchant merchant;
//getters and setters
}
My table looks like this:
`MerchantDetail` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`amountdue` decimal(19,2) DEFAULT NULL,
`optstatus` BIT() DEFAULT NULL,
`merchant_merchantId` varchar(255) NOT NULL //autogenerated by hibernate
)
My current codes are using Spring Data JPA using Hibernate.
My Rest API is using Jersey for endpoints and Jackson for marshalling and unmarshalling data.
How am I going to create a new record using JSON?