dimanche 24 septembre 2017

How does Configuration() work?

Working with Hibernate I've seen the following line:

SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory()

The thing: is I don't see how does configure pass the configuration setup to buildSessionFactory(). I expected it to be something like:

new SessionFactoryBuider.configure().build()

Which would be a builder pattern that I have seen before and I understand (the configure method applies ON SessionFactoryuBuilder). But this patter is like..."reversed".

Aucun commentaire:

Enregistrer un commentaire