Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 368592

Summary: primitive attribute-type for a virtual attribute generates non-compiling canonical metamodel code
Product: z_Archived Reporter: Karen Butzke <karenfbutzke>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Karen Butzke CLA 2012-01-13 16:42:03 EST
Using EclipseLink build EclipseLink-2.4.0.v20111209

I have an extensible entity that has a virtual attribute with a primitive attribute type. It is generating non-compiling canonical metamodel code. here is my example java class, eclipselink-orm.xml entity and the generated canonical metamodel class with a compile error (notice the int instead of Integer for the 
generic type)

public class Baz {

    private Map<String, Object> extensions;

    public <T> T get(String name) {
        return (T) extensions.get(name);
    }
 
    public Object set(String name, Object value) {
        return extensions.put(name, value);
    }
}
 	
<entity class="model.Baz" access="VIRTUAL">
	<attributes>
		<id name="id" attribute-type="int">
		</id>
		<basic name="name" attribute-type="String">
		</basic>
	</attributes>
 </entity>

@Generated(value="EclipseLink-2.4.0.v20111209-rNA", date="2012-01-13T16:38:02")
@StaticMetamodel(Baz.class)
public class Baz_ { 

    public static volatile SingularAttribute<Baz, int> id;
    public static volatile SingularAttribute<Baz, String> name;

}
Comment 1 Eclipse Webmaster CLA 2022-06-09 10:21:39 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink