My XML stores Date value as String(Client requirement) and I want that string to be stored as Date in my database as it is required for few sorting and grouping.
I created a Class which contains both JAXB and JPA annotations in a single class.
I want my Class to read/write XML with String value, but when it stored in database JPA entity should convert it as date and store it in DB.
Present code I'm reading it as String as I couldn't find neat solution:
@XmlElement(name = "TransactionDate", required = true)
protected String transactionDate;
@Basic
@Column(name = "TRANSACTIONDATE", length = 255)
public String getTransactionDate() {
return transactionDate;
}
public void setTransactionDate(String value) {
this.transactionDate = value;
Please help me in achieving it.