Hibernate MassIndexer using chained invocation for building a batch job
Make a second level Builder class

long executionId = new MassIndexer()
        .addRootEntities(Company.class, Employee.class)
        .javaSE()
        .entityManagerFactory(emf)
        .jobOperator(jobOperator)
        .start();

long executionId = new MassIndexer()
        .addRootEntities(Company.class, Employee.class)
        .javaEE()
        .start();

class MassIndexer
    MassIndexer addRootEntities(Class&lt;?&gt;...)
    SEBuilder javaSE()
    EEBuilder javaEE()

class MassIndexer.SEBuilder
    long start()
    SEBuilder entityManagerFactory(EntityManagerFactory)
...



I am not that happy with the name and using a constructor for MassIndexer
addRootEntities might go in the "constructor"
javaSE/EE maybe standalone/server or container?