}
public AddLuceneWork createAddWork(Class<T> entityClass, T 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 );
final AddLuceneWork addWork;
if ( fieldToAnalyzerMap.isEmpty() ) {
addWork = new AddLuceneWork( id, idInString, entityClass, doc );
}
else {
addWork = new AddLuceneWork( id, idInString, entityClass, doc, fieldToAnalyzerMap );
}
return addWork;
}