String idInString = objectToString(idBridge, idKeywordName, id);
queue.add( createAddWork( entityClass, entity, id, idInString, false ) );
}
else if ( workType == WorkType.DELETE || workType == WorkType.PURGE ) {
String idInString = objectToString(idBridge, idKeywordName, id);
queue.add( new DeleteLuceneWork( id, idInString, entityClass ) );
}
else if ( workType == WorkType.PURGE_ALL ) {
queue.add( new PurgeAllLuceneWork( entityClass ) );
}
else if ( workType == WorkType.UPDATE || workType == WorkType.COLLECTION ) {
String idInString = objectToString(idBridge, idKeywordName, id);
queue.add( new DeleteLuceneWork( id, idInString, entityClass ) );
queue.add( createAddWork( entityClass, entity, id, idInString, false ) );
}
else if ( workType == WorkType.INDEX ) {
String idInString = objectToString(idBridge, idKeywordName, id);
queue.add( new DeleteLuceneWork( id, idInString, entityClass ) );
queue.add( createAddWork( entityClass, entity, id, idInString, true ) );
}
else {
throw new AssertionFailure( "Unknown WorkType: " + workType );
}