[hibernate-dev] [Search] Why is global @AnalyzerDefs scanning limited to @Entity?

Guillaume Smet guillaume.smet at gmail.com
Fri Jun 21 08:26:56 EDT 2013

On Fri, Jun 21, 2013 at 12:17 PM, Sanne Grinovero <sanne at hibernate.org> wrote:
> Guillaume, could you clarify the use case once more? I am assuming it
> was all about a cleaner code organization; in that case wouldn't it be
> enough to specify a single class to be scanned for the global analyzer
> definitions?

You assume correctly.

Our core library doesn't contain any entity and I want to declare the
@AnalyzerDefs in this library to be able to use them everywhere.
Currently, we created a dummy entity to be able to do so. The fact is
that it creates a table in the database which is not very compelling.

I agree that a @MappedSuperClass would be an hack too, but it's less
ugly than an @Entity.

So scanning a single class would be enough, at least for our needs, as
we centralize all our global @AnalyzerDefs here.


More information about the hibernate-dev mailing list