views:

25

answers:

1

Hi,

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.

+1  A: 

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;
axtavt
Using a `java.util.Date` will very likely solve the WSDL generation problem (and is IMO much better than tying entities to the JDBC API). +1
Pascal Thivent
Switched to java.util.Date and its solves the WSDL generation problem
whoopy_whale