Reputation: 2141
I have some TIMESTAMP columns in my Oracle database and the JPA entities use java.sql.Timestamp to map them. Using RAD 7, I was trying to generate Web Services for my EJB methods, but it fails with the error:
The class java.sql.Timestamp is defined in a java or javax package and cannot be converted into an xml schema type
What should be done to convert the timestamps to xml schema type? I would like to retain timestamps in the database. Do I need to change the datatypes and entities?
Please provide your suggestions.
Upvotes: 1
Views: 1611
Reputation: 242786
Perhaps not an answer to your question, but why do you need java.sql.Timestamp
in JPA entities? JPA can map database timestamps to java.util.Date
:
@Temporal(TemporalType.TIMESTAMP)
private Date timestampField;
Upvotes: 2