Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Entity Bean Generation from Postgres 8.4 database
Entity Bean Generation from Postgres 8.4 database [message #830187] Tue, 27 March 2012 10:05 Go to next message
shalin lazar is currently offline shalin lazarFriend
Messages: 18
Registered: February 2012
Junior Member
Hi all,

I've posted elsewhere on the boards, and a kind individual has directed me here. I built a PostgreSQL 8.4 database, but am having problems generating the Entity Beans via JPA's generation tool. He informed me that this wasn't an issue with EclipseLink, so here I am.

Basically I have two problems:

1) Not all Entity Beans are generated (database has around 250 tables).
2) I'm getting various association 'naming' errors.

Basically, I didn't name my foreign key columns <foreignTableName>_<foreignTableColumnName>. Is there any way around this issue (not considering going through all the tables and renaming columns)? And if that is the only option, what would I do if I have two columns referencing the same column on the same table?

Eg. accountTransactCenter.accountId -> account.id and accountTransactCenter.contraAccountId -> account.id

I would really appreciate any help. If you need more information, please let me know.

Thanks and best regards.

[Updated on: Tue, 27 March 2012 10:06]

Report message to a moderator

Re: Entity Bean Generation from Postgres 8.4 database [message #830310 is a reply to message #830187] Tue, 27 March 2012 13:12 Go to previous messageGo to next message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 3/27/2012 4:05 AM, shalin lazar wrote:
> Hi all,
>
> I've posted elsewhere on the boards, and a kind individual has directed
> me here. I built a PostgreSQL 8.4 database, but am having problems
> generating the Entity Beans via JPA and EclipseLink. He informed me that
> this wasn't an issue with EclipseLink, so here I am.
>
> Basically I have two problems:
>
> 1) Not all Entity Beans are generated (database has around 250 tables).
> 2) I'm getting various association 'naming' errors.
>
> Basically, I didn't name my foreign key columns
> <foreignTableName>_<foreignTableColumnName>. Is there any way around
> this issue (not considering going through all the tables and renaming
> columns)? And if that is the only option, what would I do if I have two
> columns referencing the same column on the same table?
>
> Eg. accountTransactCenter.accountId -> account.id and
> accountTransactCenter.contraAccountId -> account.id
>
> I would really appreciate any help. If you need more information, please
> let me know.
>
> Thanks and best regards.

This is the Eclipse web tools platform forum.

Your question has little to nothing to do with web platform, it would be
more appropriate in the Eclipse data tools or Eclipse Links forums.
(That may be what you mean by "elsewhere on the boards".) For something
like this, I'd ask on stackoverflow.
Re: Entity Bean Generation from Postgres 8.4 database [message #830329 is a reply to message #830310] Tue, 27 March 2012 13:42 Go to previous messageGo to next message
shalin lazar is currently offline shalin lazarFriend
Messages: 18
Registered: February 2012
Junior Member
Thanks and sorry Russel. I did land up on this forum from a link posted on Dali Java Persistence Tools page. Stackoverflow it is then.

[Updated on: Tue, 27 March 2012 13:43]

Report message to a moderator

Re: Entity Bean Generation from Postgres 8.4 database [message #830357 is a reply to message #830329] Tue, 27 March 2012 14:24 Go to previous messageGo to next message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 3/27/2012 7:42 AM, shalin lazar wrote:
> Thank and sorry Russel. I did land up on this forum from the link posted
> on Dali Java Persistence Tools page. Stackoverflow it is then.

--just saying. Sometimes a "between two worlds" problem is hard to
resolve. stackoverflow is particularly good at it.
Re: Entity Bean Generation from Postgres 8.4 database [message #830359 is a reply to message #830329] Tue, 27 March 2012 14:33 Go to previous messageGo to next message
Karen Butzke is currently offline Karen ButzkeFriend
Messages: 220
Registered: July 2009
Senior Member
Actually, since Dali Java Persistence Tools Project (JPT) is a subproject of the Web Tools Project this is a perfectly fine place for these questions. An even better place would be the Dali forum http://www.eclipse.org/forums/index.php/f/113/ since the Entity Generation code is written in the JPT plugins.

It seems odd to me that Dali has generated @JoinColumns({}) when it sounds like we should have generated @JoinColumns(name="currencyId", referenceColumnName="id"). Given that and the fact that not all of the Entities are being generated I wonder if you have errors in the error log after the generation. If that is the case you could post the stack trace or log a bug against Web Tools -> Dali JPA Tools.

Thanks,
Karen
Re: Entity Bean Generation from Postgres 8.4 database [message #830377 is a reply to message #830187] Tue, 27 March 2012 14:53 Go to previous messageGo to next message
Karen Butzke is currently offline Karen ButzkeFriend
Messages: 220
Registered: July 2009
Senior Member
I have also entered a bug against Dali to make our specific forum more prominent on our website. I think this is a result of being a subproject of WTP, we have the WTP banner at the top of our page instead of a more specific banner.
Re: Entity Bean Generation from Postgres 8.4 database [message #831179 is a reply to message #830377] Wed, 28 March 2012 15:18 Go to previous messageGo to next message
shalin lazar is currently offline shalin lazarFriend
Messages: 18
Registered: February 2012
Junior Member
Well no responses from stackoverflow. In fact, the best responses I've got thus far have been from Karen.

By stack trace, do you mean any outputs on Indigo's console? where can I find a log of errors other than the 'Markers' view?

Its exactly as you say ... @JoinColumns({}) instead of JoinColumns(name="currencyId", referenceColumnName="id"). But, if I try editing the generated code as such (and I don't like editing generated code) a new error is raise stating that currencyId cannot be resolved on the table. So I really don't know what to do.

I'm think about trying helios and/or going back to NetBeans, cause this is taking up a lot of time, and I haven't got any responses or found a solution yet.
Re: Entity Bean Generation from Postgres 8.4 database [message #831224 is a reply to message #831179] Wed, 28 March 2012 16:32 Go to previous messageGo to next message
Karen Butzke is currently offline Karen ButzkeFriend
Messages: 220
Registered: July 2009
Senior Member
Quote:
Well no responses from stackoverflow. In fact, the best responses I've got thus far have been from Karen.


I'm trying my best to help now, I didn't see you on EclipseLink or WTP forums until others had responded. I know it's tough for users to know which project is implementing which functionality.

Quote:
By stack trace, do you mean any outputs on Indigo's console? where can I find a log of errors other than the 'Markers' view?


There is a view called 'Error Log'. Use ctrl-3 and type in Error Log. This is for exceptions that happen while running eclipse. If there is an exception occuring while generating entities, that could explain why the empty JoinColumns() annotation is being generated.

On stack overflow I see you saying that not all the entity beans are generated. Why are you generating them 70 tables at a time? Was there a problem you hit trying to do all 250 tables? Dali will not generate the entities correctly if there are references between tables and you don't generate those at the same time.

Thanks,
Karen
Re: Entity Bean Generation from Postgres 8.4 database [message #831238 is a reply to message #831224] Wed, 28 March 2012 16:58 Go to previous message
Karen Butzke is currently offline Karen ButzkeFriend
Messages: 220
Registered: July 2009
Senior Member
http://www.eclipse.org/forums/index.php/t/318389/ - further discussion on the Dali forum
Previous Topic:Programatically Creating Deployment Descriptor
Next Topic:I want to contribute to eclipse sse line completion but the content assist framework is internal
Goto Forum:
  


Current Time: Fri Mar 29 09:06:51 GMT 2024

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

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

Back to the top