Thursday, 16 February 2012

What is meant by Method chaining? | Java Hibernate

Method chaining is a programming technique that is supported by many hibernate interfaces. This is less readable when compared to actual java code. And it is not mandatory to use this format. Look how a SessionFactory is created when we use method chaining. 
SessionFactory sessions = new Configuration() 
    .addResource("myinstance/MyConfig.hbm.xml")
    .setProperties( System.getProperties() )
    .buildSessionFactory(); 

No comments: