Integrating Hibernate and jPOS Framework

Today i want to share about Integrating Hibernate and jPOS Framework. The implementation will based on my old post about Implementation jPOS Transaction Manager you can read the jPOS project on these post. The jPOS System is look like: i will add new participant for FinancialTransaction group called FinancialTransactionLogging, the participant is responsible for inserting the FinancialTransactionQueryRemoteHost response into database using Hibernate framework. First, For integrating Hibernate and jPOS, i create new qbean called HibernateManager that extends org.jpos.q2.QBeanSupport the initService methods will buildSessionFactory for init the hibernate SessionFactory object.

Continue reading

Implementation Template Methods Design Pattern

Today i want to share about Implementation Template Methods Design Pattern for hibernate session management. Based on javapapers website, Template pattern is: Template method design pattern is to define an algorithm as skeleton of operations and leave the details to be implemented by the child classes. The overall structure and sequence of the algorithm is preserved by the parent class. you can read more about Template method design pattern on javapapers site. This post will explain the Implementation Template Methods Design Pattern for hibernate session management. this methods is ensure

Continue reading

Hibernate Mapping Entity with multiple primary key

Today i want to share about Hibernate Mapping Entity with multiple primary key. For some reason we need to add multiple key in our database table, for example: you have table S_PARAMETER that will save all updatable parameter in your system and for some reason(easy read, clean code) you nedd param_group, and param_id field to get the value. And how hibernate mapping can achieve that? First, the table structure is like this: And you need to create entity class to map table datas into your class domain/pojo. Because Hibernate only

Continue reading