Approach 1 Load that object from the database, and modify its values, now hibernate automatically modifies the values on to database also, when ever the transaction is committed. Approach 2: If we want to modify object in the database, then create new object with same id and we must call update() given by session interface. Files required to execute this program. • Product.java (My POJO class) • product.hbm.xml (Xml mapping file ) • hibernate.cfg.xml (Xml configuration file) • ClientProgram.java(java file to write our hibernate logic) Related to approach 1: Product.java (POJO). Files required to execute this program. • Product.java (My POJO class) • product.hbm.xml (Xml mapping file ) • hibernate.cfg.xml (Xml configuration file) • ClientProgram.java(java file to write our hibernate logic) Related to approach 1: Product.java (POJO).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
March 2019
Categories |