Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » JPA Generate Entities from Tables fails(JPA Generate Entities from Tables fails on Foreign Keys)
JPA Generate Entities from Tables fails [message #1404154] Wed, 30 July 2014 05:29
Brad OHearne is currently offline Brad OHearneFriend
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 @[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.


Previous Topic:JAXB : EclipseLink-3002 while unmarshalling xml even JAXB RI works
Next Topic:Shared/Global Persistence Unit?
Goto Forum:

Current Time: Fri May 25 10:41:18 GMT 2018

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

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

Back to the top