Meaningless Drivel is fun!*
The moose likes Object Relational Mapping and the fly likes Difficulty assigning Java Util Date to TemporalType field in Entity Bean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Difficulty assigning Java Util Date to TemporalType field in Entity Bean" Watch "Difficulty assigning Java Util Date to TemporalType field in Entity Bean" New topic
Author

Difficulty assigning Java Util Date to TemporalType field in Entity Bean

Jack Bush
Ranch Hand

Joined: Oct 20, 2006
Posts: 235
Hi All,

I have getting the following syntax/compilation error (line 5, 6 below) when trying to enter the system date to Temporal Type:

setCollectionDate(java.util.Date) in domain.Customer cannot be applied to (java.lang.String).


I am running JDK 1.6.0_10, Glassfish v2r2, MySQL 5.0, Netbeans 6.1 on Windows XP platform.

I have also posted this question on http://forums.sun.com/thread.jspa?threadID=5338230 as well.

Any assistance would be much appreciated.

Thanks in advance,

Jack
Edvins Reisons
Ranch Hand

Joined: Dec 11, 2006
Posts: 364
The format method returns a String, which you cannot put into a Date field.
I think you need to use a Date without formatting it.
Jack Bush
Ranch Hand

Joined: Oct 20, 2006
Posts: 235
Hi Edvins,

Thanks for your advice which has resolved this issue.

Jack
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Difficulty assigning Java Util Date to TemporalType field in Entity Bean