|JPA Generate Entities from Tables fails [message #1404154]
||Wed, 30 July 2014 05:29
| Brad OHearne
Registered: July 2014
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 plugin 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.
Powered by FUDForum
. Page generated in 0.02216 seconds