I've created a class called LuceneInterceptor that implements org.hibernate.Interceptor. It's basically the same as the second example here:
http://www.hibernate.org/138.html
What I'm trying to do is populate the Lucene directory with a document every time an object is loaded. I've implemented onLoad but this method is called just
before an object is initialized. This seems to mean that the id (primary key) of the object is set but every other parameter is null. What I want is a method that's called just
after an object is initialized. Then I can return a fully populated org.apache.lucene.document.Document from the object and add it to my Lucene directory.
Has anyone else done this? It must be a common requirement to populate a directory when objects are loaded from the database.