Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to get all entities in a list ?

Mark Uppeteer
Ranch Hand
Posts: 159
C++ Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

For a test case I would like to get all my entities (every class with the annotation @Entity)
so that I can loop them and perform a find. This way mapping errors are visible quickely.

This works fine but I have to list all my entities ...what I would like is write a test that keeps working all
the time, also when new entities are added to the project.

So I would like to find out how to get all mapped classes on the classpath in an array or something.

Any ideas ?

thanks a lot!
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!