Canonical model class is not working after changing the class name [message #1067495] |
Tue, 09 July 2013 06:08 |
Saravanan Subiramaniam Messages: 10 Registered: April 2013 |
Junior Member |
|
|
By default, eclipselink generates the canonical model classname which is same as the entity class name with the default suffix '_'. However, I wanted to change the generated canonical meta model class name, so I created custom CanonicalModelProcessor extending eclipselink's CanonicalModelProcessor.
For instance, my entity name is EmployeeEntity and wanted to generate meta model class as Employee_.java (instead of EmployeeEntity_.java).
So, my generated class looks like:
@Generated(value="EclipseLink-2.3.2.v20111125-r10461", date="2013-07-09T07:54:49")
@StaticMetamodel(EmployeeEntity.class)
public class Employee_ {
public static volatile SingularAttribute<EmployeeEntity, Integer> id;
}
But it looks like the meta model is initialized only if the name matches with the entity name. Because when I access Employee_.id.getName() --> it returns null. Can anyone explain this behaviour? Is it necessary for the meta model class to have the same name as that of entity name?
[Updated on: Tue, 09 July 2013 16:37] Report message to a moderator
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03252 seconds