Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » getId of metaModel will NEVER work for embededID
getId of metaModel will NEVER work for embededID [message #770829] Sun, 25 December 2011 08:35 Go to next message
elhanan Maayan is currently offline elhanan Maayan
Messages: 131
Registered: November 2009
Senior Member
hi..
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(
"metamodel_identifiable_id_attribute_type_incorrect",
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 #777517 is a reply to message #770829] Tue, 10 January 2012 11:13 Go to previous message
James Sutherland is currently offline James Sutherland
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

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


James : Wiki : Book : Blog : Twitter
Previous Topic:getId of metaModel will NEVER work for embededID
Next Topic:Setting Cache expiry in persistance.xml
Goto Forum:
  


Current Time: Fri Aug 01 01:49:35 EDT 2014

Powered by FUDForum. Page generated in 0.04389 seconds