Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (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 Herczeg
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(PackageGenerator.java:245)
at org.eclipse.jpt.jpa.gen.internal.PackageGenerator.generateInternal(PackageGenerator.java:112)
at org.eclipse.jpt.jpa.gen.internal.PackageGenerator.doGenerate(PackageGenerator.java:90)
at org.eclipse.jpt.jpa.gen.internal.PackageGenerator.generate(PackageGenerator.java:67)
at org.eclipse.jpt.jpa.ui.internal.wizards.gen.GenerateEntitiesFromSchemaWizard$GenerateEntitiesJob.runInWorkspace(GenerateEntitiesFromSchemaWizard.java:248)
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
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(ASTMethod.java:286)
at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:203)
at org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReference.java:419)
at org.apache.velocity.runtime.parser.node.ASTExpression.value(ASTExpression.java:73)
at org.apache.velocity.runtime.parser.node.ASTSetDirective.render(ASTSetDirective.java:125)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:74)
at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:88)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:74)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:318)
at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:107)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:318)
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 Butzke
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.

Karen
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 Kuiper
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.

Thanks,

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: Thu Oct 30 19:09:06 GMT 2014

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

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