Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-08-2009, 02:52 PM
Member
 
Join Date: Feb 2009
Posts: 6
Rep Power: 0
Inks is on a distinguished road
Default Persistence problem when changing type to java.sql.Time
Hi. I'm writing a database application for my college course, using tables which were created in Netbeans.

In my database, I have a field (named "DURATION") of type TIME, but the generated code in the table's Class uses java.util.Date. Using this, the table in the swing form will, of course, only display the "zero epoch" value of January 1, 1970.

But I need the app to display a time in the format "00:00:00". In other words, I want to use java.sql.Time instead. Is this the right way to achieve this? Or do I need to parse the date to extract the time from it and display?

I tried changing util.Date to sql.Time: By going through my code and changing the relevant "util.Date" types to "sql.Time", all I got for my trouble was a persistence error:

Code:
SEVERE: Application class seatoursdb.SeaTourDBApp failed to launch
javax.persistence.PersistenceException: No Persistence provider for EntityManager named seatoursdbPU: Provider named org.hibernate.ejb.HibernatePersistence threw unexpected exception at create EntityManagerFactory: 
java.lang.NoClassDefFoundError
java.lang.NoClassDefFoundError: org/hibernate/proxy/EntityNotFoundDelegate

The NoClassDefFoundError in particular makes me think I've missed something that I'd need to replace to move from Date to Time, but I can't find it in my code.

In all, I'm not sure where to go from here. I've been through the Javadocs for Time and Date and those for the Errors thrown, amongst others, and am still none the wiser. If you've any suggestions (minus "bugger off" ), or need me to post more information/code to help, I'd greatly appreciate the help. Thanks.
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Java Persistence API - annotations - III JavaForums Java Blogs 0 07-27-2008 12:00 AM
Java Persistence API - annotations - II JavaForums Java Blogs 0 07-27-2008 12:00 AM
Java Persistence API - annotations - I JavaForums Java Blogs 0 07-27-2008 12:00 AM
Java applet and Javascript type problem Interdit Java Applets 0 05-27-2008 02:38 PM
Hibernate Java Persistence JavaBean Java Tutorials 0 09-22-2007 11:02 PM


All times are GMT +2. The time now is 12:13 PM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org