I have some TIMESTAMP columns in my Oracl开发者_如何学Goe 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.
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;
精彩评论