Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » getId of metaModel will NEVER work for embededID(possible major bug...)
icon5.gif  getId of metaModel will NEVER work for embededID [message #770827] Sun, 25 December 2011 13:35 Go to next message
elhanan Maayan is currently offline elhanan MaayanFriend
Messages: 131
Registered: November 2009
Senior Member
i tried posting this in bugzilla but something is wrong anyway here's the code in getId of IdentifybleTypeImpl:
 for(SingularAttribute<? super X, ?> anAttribute : idAttributes) {
                // Verify type is correct - relax restriction on null and Object.class (from same classLoader)
                if(null == type || Object.class == type || 
                        ((type != null) && (type.getCanonicalName().equals(anAttribute.getJavaType().getCanonicalName())))) {
                    idAttribute = (SingularAttribute<? super X, Y>) anAttribute;
                } else {
                    throw new IllegalArgumentException(ExceptionLocalization.buildMessage(
                        new Object[] { anAttribute, this, type, anAttribute.getJavaType() }));

problem is that in case of embdebleid this will ALWAYS fall on IAE cause no matter what, the set if idAttributes is different.

so either type is equal to the first or second, but if it equels to the first then the second comparison (or the one after that) will break it..
Re: getId of metaModel will NEVER work for embededID [message #777522 is a reply to message #770827] Tue, 10 January 2012 16:13 Go to previous message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

Please log a bug and include your model and exception stack trace.

James : : :

James : Wiki : Book : Blog : Twitter
Previous Topic:Weving
Next Topic:getId of metaModel will NEVER work for embededID
Goto Forum:

Current Time: Tue Jan 26 09:05:29 GMT 2021

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

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

Back to the top