Hmm, yeah, since the original code (in QueryInterceptor) didn't use generics, I didn't even think of introducing generics here. But, if we introduce generics, there need to be two methods: createPerEntityWorks(T value, Serializable id, WorkType workType) and createPerEntity*Type*Works(Class<T> clazz, WorkType workType), since WorkType.PURGE_ALL uses the entity class as value. 

This does make SearchWorkCreator a lot cleaner, actually. I'll need to see what this does to QueryInterceptor, though.