}
public AddLuceneWork createAddWork(Class<?> entityClass, Object entity, Serializable id, String idInString, InstanceInitializer sessionInitializer, ConversionContext conversionContext) {
Map<String, String> fieldToAnalyzerMap = new HashMap<String, String>();
Document doc = getDocument( entity, id, fieldToAnalyzerMap, sessionInitializer, conversionContext, null );
final AddLuceneWork addWork;
if ( fieldToAnalyzerMap.isEmpty() ) {
addWork = new AddLuceneWork( id, idInString, entityClass, doc );
}
else {
addWork = new AddLuceneWork( id, idInString, entityClass, doc, fieldToAnalyzerMap );
}
return addWork;
}