-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Metamodel generation - model classes implementing interfaces
PostPosted: Fri Mar 09, 2012 11:49 am 
Newbie

Joined: Tue May 03, 2011 10:57 am
Posts: 4
Location: Bucharest, Romania
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.


Top
 Profile  
 
 Post subject: Re: Metamodel generation - model classes implementing interfaces
PostPosted: Mon Mar 12, 2012 9:08 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Hi,

I don't think that this is possible. At some stage the static metamodel needs to be populated. At runtime there is really only one instance of a given metamodel class. How would that work?

--Hardy


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.