aspose file tools*
The moose likes Object Relational Mapping and the fly likes Debugging table creation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Debugging table creation" Watch "Debugging table creation" New topic
Author

Debugging table creation

Kristopher Matthews
Greenhorn

Joined: Sep 29, 2010
Posts: 6
Earlier today one of my tables was failing to be created - no message in any log or output that I could find, just the table wasn't there. So when my unit test attempted to store data in that table, it failed to do so. I eventually (through curse laden trial and error) discovered the culprit:



Commenting out the column annotation fixes the issue. Okay, so maybe that annotation doesn't belong there and is a stupid idea, .. but is there a way to debug this in the future? I'd like to see why the table isn't created, or at least some kind of hint that it wasn't created.
Kristopher Matthews
Greenhorn

Joined: Sep 29, 2010
Posts: 6
Correction, it has nothing to do with that column annotation. It randomly fails to create the table about 80% of the time. The other 20% it seems to magically work.



Notice nothing about my other tables. Or that it is not dropping the sequence table first. Arrrrgh.
Kristopher Matthews
Greenhorn

Joined: Sep 29, 2010
Posts: 6
Everything is working fine, this was just a litany of errors brought on by a late night and unfamiliarity.

The original problem was that my entity was named "User." The second problem was me not noticing that glassfish was only logging FAILED table create/drops, not successful ones. The third problem was me not refreshing the list of tables in the DB view.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Debugging table creation
 
Similar Threads
Runtime Creating Tables
JPA - How to specify precision in automatically created SEQUENCE table?
CollectionOfElements
Hibernate, Inheritance of entities.. One table too much..
JPA Annotation @Column + column defination