开发者

Using timestamps causing trouble with WSDL generation

开发者 https://www.devze.com 2023-01-17 08:20 出处:网络
I have some TIMESTAMP columns in my Oracl开发者_如何学Goe database and the JPA entities use java.sql.Timestamp to map them.

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;
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号