JPA Generate Entities From Tables Fails [message #1404153] |
Wed, 30 July 2014 05:26 |
Brad OHearne Messages: 3 Registered: July 2014 |
Junior Member |
|
|
I am trying to generate entities from tables on a SQL Server database. Whenever I try to generate these entities, every table with a foreign key fails to generate an entity (though there is a reference to that entity in the persistence.xml, which then results in an error).
The error which I'm receiving on all the entities which fail to generate (and there are quite a few across the schema which fail) are as follows (with varying table and foreign key names):
org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getImportStatements' in class org.eclipse.jpt.jpa.gen.internal.ORMGenTable threw exception java.lang.IllegalStateException: MyTable1.FK_MyTable1_MyTable2 - mismatched sizes: 0 vs. 1 @ main.java.vm[7,9]
I have gone through the "Generate Entities from Tables" wizard about 20 times, and there doesn't seem to be any configurable option which can affect this, nor hint of any error in the wizard. There appears to be no way for me to affect this.
I have done my share of Googling of this problem, and found a few references to a similar (possibly the same) issue going back to 2008 -- a bug in the Dali tools related to SQL Server. I would hope that 6 years would be enough time to possibly rectify the problem, but it appears as of a year ago, it still hadn't been fixed.
Does anyone know a way around this? Is there a fix or a workaround? Without getting past this problem, JPA projects and the JPA plugin on Eclipse is utterly useless for use with SQL Server.
Any help is appreciated.
Thanks,
Brad
|
|
|
|
Re: JPA Generate Entities From Tables Fails [message #1404245 is a reply to message #1404215] |
Wed, 30 July 2014 15:35 |
Brad OHearne Messages: 3 Registered: July 2014 |
Junior Member |
|
|
Neil,
Thanks for the reply. Yeah, the bug you mentioned is indeed the bug -- you might have noticed the most recent post on the bug is from me. To your questions:
- When going through the "Generate Entities from Tables" wizard, it appears to detect all of the relationships between tables properly, and the detail when I click on these relationships shows the proper fields are linked. But the generation of the entities themselves when the wizard is finished still fails.
- I am using a base (pure) install of Kepler. Eclipse was not installed as a part of any other commercial product install.
Here's one more nugget of information. If I try to generate only a single entity (rather than multiple entities) on one of these tables that fails when generating the entire collection of tables, when I go to the wizard dialog that shows relationships, there are none (because there's only a single table in play), but however, the entity generation STILL fails with the same error. In other words, there is no way to generate an entity on these tables with foreign keys.
Strange....
Brad
|
|
|
Powered by
FUDForum. Page generated in 0.03573 seconds