Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Eclipse Dali generate entities from tables problem(when a foreign key is primary key too)
Eclipse Dali generate entities from tables problem [message #876783] Fri, 25 May 2012 09:25 Go to next message
Balint Herczeg is currently offline Balint HerczegFriend
Messages: 1
Registered: May 2012
Junior Member
So in this example, there are 2 tables :

table people:
id: int
code: int

Id and code are both unique and primary keys.

table something:
id: int
peopleCode: int

In this table id and peopleCode are both primary keys, of course there is no good reason why peopleCode is primary key, it's not a well-designed database, and it has never been used with JPA, but I have to use this old database for a new project.

The two tables are in one to many relation with code-peopleCode, one 'people' has many 'something'. There is no foreign key constraint anyway.

I tried to generate entities from these tables with Eclipse Dali, I added the associations in the wizard, but I got the following error message, and table 'something' hadn't been generated:

org.eclipse.core.runtime.CoreException: Unable to find JPA entities generation templates in pluginorg.eclipse.jpt.jpa.gen
at org.eclipse.jpt.jpa.gen.internal.PackageGenerator.generateClass(
at org.eclipse.jpt.jpa.gen.internal.PackageGenerator.generateInternal(
at org.eclipse.jpt.jpa.gen.internal.PackageGenerator.doGenerate(
at org.eclipse.jpt.jpa.gen.internal.PackageGenerator.generate(
at org.eclipse.jpt.jpa.ui.internal.wizards.gen.GenerateEntitiesFromSchemaWizard$GenerateEntitiesJob.runInWorkspace(
Caused by: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'convertToJavaStringLiteral' in class org.eclipse.jpt.jpa.gen.internal.BaseEntityGenCustomizer threw exception java.lang.NullPointerException @ join.vm[58,44]
at org.apache.velocity.runtime.parser.node.ASTMethod.execute(
at org.apache.velocity.runtime.parser.node.ASTReference.execute(
at org.apache.velocity.runtime.parser.node.ASTReference.value(
at org.apache.velocity.runtime.parser.node.ASTExpression.value(
at org.apache.velocity.runtime.parser.node.ASTSetDirective.render(
at org.apache.velocity.runtime.parser.node.ASTBlock.render(
at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(
at org.apache.velocity.runtime.parser.node.ASTBlock.render(
at org.apache.velocity.runtime.parser.node.SimpleNode.render(
at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(
at org.apache.velocity.runtime.parser.node.SimpleNode.render(
Re: Eclipse Dali generate entities from tables problem [message #879259 is a reply to message #876783] Wed, 30 May 2012 21:34 Go to previous messageGo to next message
Karen Butzke is currently offline Karen ButzkeFriend
Messages: 220
Registered: July 2009
Senior Member
I was able to reproduce this and have entered bug 381112 against Dali. Thanks for reporting this issue.

Re: Eclipse Dali generate entities from tables problem [message #941136 is a reply to message #879259] Fri, 12 October 2012 08:36 Go to previous message
Daniel Kuiper is currently offline Daniel KuiperFriend
Messages: 1
Registered: October 2012
Junior Member
Dear Karen,

I have the same problem.
I see the bug is fixed.
How do I apply the fix to my RAD 8.

I'm still learning.


Daniel Kuiper.
Previous Topic:enquiry about starting j2ee development with wasce2.1.1.5
Next Topic:use emf model to create SOAP Request
Goto Forum:

Current Time: Sat Apr 21 11:53:02 GMT 2018

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

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