On Thu 2014-08-21 19:48, Hardy Ferentschik wrote:
On 21 Jan 2014, at 17:03, Emmanuel Bernard <emmanuel(a)hibernate.org> wrote:
> Your idea of reusing Jandex won't quite fully work when people put their
> classes in different jars.
Well, the assumption of course is that we can handed a aggregated/composite index
over all jars.
There is a caveat though, we keep talking that we get the index from a container or
from ORM, but we need to take care of building our own index as well in case we don’t
get a Jandex index passed. In this case we need to scan classes.
The hard part (and I did it in Hibernate EM) is
1. to find all jars involved: the discovery mechanism is pretty much
working by accident and classloader hacking
2. to scan the jar: it's easy for zip or directory based JARs, not so
easy for JARS made of different URL prototols and opaque URLs
On the other side, ORM does the Jandex building thing as well on the metamodel branch.
So I guess that once we depend on ORM 5 we can get in all cases a Jandex index.
Question is when that will be?
Remember, Hibernate Search is not ORM only. So the discovery mechanism cannot
fully depend on an ORM feature not as a hard dep at least.