Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsCanonical model class is not working after changing the class name
https://www.eclipse.org/forums/index.php/mv/msg/490092/1067495/#msg_1067495
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?
]]>Saravanan Subiramaniam2013-07-09T06:08:25-00:00Re: Canonical model class is not working after changing the class name
https://www.eclipse.org/forums/index.php/mv/msg/490092/1067620/#msg_1067620
Chris Delahunt2013-07-09T15:33:40-00:00Re: Canonical model class is not working after changing the class name
https://www.eclipse.org/forums/index.php/mv/msg/490092/1067626/#msg_1067626
Yes, I was specifying EmployeeEntity.class in StaticMetamodel annotation (it was a typo mistake in earlier thread).]]>Saravanan Subiramaniam2013-07-09T16:36:19-00:00Re: Canonical model class is not working after changing the class name
https://www.eclipse.org/forums/index.php/mv/msg/490092/1067646/#msg_1067646
Chris Delahunt2013-07-09T19:30:14-00:00Re: Canonical model class is not working after changing the class name
https://www.eclipse.org/forums/index.php/mv/msg/490092/1073195/#msg_1073195
It worked after adding the custom meta model class name in the persistence unit and it worked. Thanks!]]>Saravanan Subiramaniam2013-07-24T09:47:26-00:00