[hibernate-dev] [SEARCH] @Indexed on abstract classes

Guillaume Smet guillaume.smet at gmail.com
Thu May 10 02:49:31 EDT 2012


Hi Search team,

I have this question for a long time but, this time, having 30 (and
growing) indexed entities inheriting from an abstract class, I thought
I might as well ask about it...

Is there any reason why we can't set the @Indexed annotation on the
abstract class to get all the implementations indexed in their
separate indexes? This way, I wouldn't have to put the annotation on
each implementation and think about adding it each time I extend this
abstract class.

Another painful things that beats me yesterday is that I cannot do:
searchFactory.buildQueryBuilder().forEntity(MyAbstractEntity.class).get();
to build Lucene queries based on the common indexed fields of the
abstract class: I'm forced to use one of the concrete implementation
(and apart that it's not that nice, I'm not that confident I can
choose one that will never be removed from the code base).

Thanks for your feedback.

-- 
Guillaume


More information about the hibernate-dev mailing list