Hi,
I'm using the JPA 2 Metamodel (generated via the Hibernate Metamodel Generator); my entities are rather simple (and not that relevant for the purpose of this thread); all my entities implement the
Code:
IEntity
interface (with the following method):
Code:
long getId();
It would help (and make sense) if the generated classes would also implement this kind of interface, so that I can work against that instead of having to write the queries each and every time against the specific generated metamodel classes; for example, if I have:
Code:
Role implements IEntity
, it would be good if the generated classes would also:
Code:
Role_ implement IEntity_<Role>
, where:
Code:
IEntity_
would have the following method:
Code:
public SingularAttribute< T, Long > getId(){
return id;
}
simply working with a bit of generics and returning the generated id.
Is this type of approach feasible? Does it have flaws? Should I open up a JIRA to track it?
Any feedback is appreciated.
Thanks.
Eugen.