It's in onSave method. This method will be executed BEFORE the DB INSERT
occurs. So entity doesn't have an id yet. Therefore you will have
NullPointerException when try to add it to Lucene index. I think it will
be better to implement this functionality somewhere else (in
DefaultPostInsertEventListener probably?) |