-->
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.  [ 3 posts ] 
Author Message
 Post subject: Get all classes annotated with @Entity
PostPosted: Sun Apr 30, 2006 4:44 pm 
Beginner
Beginner

Joined: Thu Sep 08, 2005 10:29 am
Posts: 21
Hi,

This question is not really related to Hibernate or EJB3, but I don't know where to post this else.

I'm in need of a framework or example to retrieve all classes which are annotated with a specific annotation class (e.g. a @Entity or @CustomAnnotation). Something like findClasses(Class annotation);

As Hibernate will something similar to get all @Entities, I might find some advise on this forum?

Regards,
Marcel


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 01, 2006 2:56 pm 
Beginner
Beginner

Joined: Wed Apr 26, 2006 2:41 pm
Posts: 30
If you have all of your code in one tree at build time (ie, not dynamically discovered) I would recommend using the Java5 Annotations Preprocessor Tool (APT) to create a class that can return this. This way you can create a java file that has all the needed information as part of an ant task and include it into your build.

This way you can also search for @CustomAnnotations as well.


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 01, 2006 4:27 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Check for the EJB code base and esp JarVisitor

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.