Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » generate JPA entities from tables(problem with database)
generate JPA entities from tables [message #1022059] Thu, 21 March 2013 08:04 Go to next message
Marco Westermann is currently offline Marco WestermannFriend
Messages: 4
Registered: March 2013
Junior Member
Hi,

When I try to generate classes from my database tables through "JPA tools -> generate entities from tables" I do not get any schemas from my database. I use a Gupta SQLBase DB which not properly work with schemas. Is it somehow possible to see all tables from all schemas, so I can generate the classes?

regards, Marco
Re: generate JPA entities from tables [message #1022305 is a reply to message #1022059] Thu, 21 March 2013 16:37 Go to previous messageGo to next message
Brian Vosburgh is currently offline Brian VosburghFriend
Messages: 137
Registered: July 2009
Senior Member
That depends on what DTP driver you are using to connect to your database. Dali (the component of WTP that provides the JPA functionality) uses DTP to retrieve metadata from the database and uses that metadata to generate entities. The easiest way to determine how well DTP interacts with your database is to to open a Data Source Explorer view, connect to your database, and expand the elements in the tree. If you can see your tables listed in that tree, Dali should be able to find those tables and present them to you.
Re: generate JPA entities from tables [message #1022615 is a reply to message #1022305] Fri, 22 March 2013 08:47 Go to previous messageGo to next message
Marco Westermann is currently offline Marco WestermannFriend
Messages: 4
Registered: March 2013
Junior Member
Hi Brian,

thank you for your response. I tested what you said. but the data source explorer doesnt show any tables. It also doesnt show any schemas. Do you know how Dali tries to discover the schemas from the database? I tried the DatabaseMetaData.getSchemas method of my jdbc driver and it returns two schemas. the getCatalogs() method therefor doesnt return valid schemas.

Any further ideas?

regards Marco
Re: generate JPA entities from tables [message #1022723 is a reply to message #1022615] Fri, 22 March 2013 12:26 Go to previous messageGo to next message
Marco Westermann is currently offline Marco WestermannFriend
Messages: 4
Registered: March 2013
Junior Member
I ust figured out that dali uses the getCatalogs method to get the schemas. The jdbc driver returns an empty result set on this method. Is it possible to let dali use the getSchemas method instead?

regards, Marco
Re: generate JPA entities from tables [message #1022765 is a reply to message #1022723] Fri, 22 March 2013 13:32 Go to previous message
Marco Westermann is currently offline Marco WestermannFriend
Messages: 4
Registered: March 2013
Junior Member
I got it to work. I reimplemented the getCatalogs and getSchemas method in the jdbc (by proxying it) and now everything works fine.

regards, Marco
Previous Topic:Apache Derby UI installation exception
Next Topic:Attempting to develop a web page with JavaScript.I
Goto Forum:
  


Current Time: Thu Apr 25 05:29:45 GMT 2024

Powered by FUDForum. Page generated in 0.03074 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top