Struts1 Spring and Hibernate Integration

Register.jsp

Failure.jsp

Success.jsp

web.xml

struts-config.xml

applicationContext.xml

RegisterForm.java

RegisterAction.java

Register.hbm.xml

Register.java

RegisterDao.java

RegisterDao.Impl.java

RegisterBoImpl.java

RegisterBo.java

Hibernate mapping files detail

Mapping Declaration Object/relational mappings are usually defined in XML document. The mapping language is Java-centric, meaning that mappings are constructed around persistent class declarations, not table declarations. Mapping Document

The element maps the domain object with corresponding entity in the database. hibernate-mapping element allows you to nest several persistent mappings, as shown above. It … Read more

Detail of program

Hibernate client application is the actual application who wants to intrect with database software. In the client application development two important roles are involved. get hibernate session object from a pool called hibernate seassionFactory. Use hibernate session object to perform curd operation on the database table. Persistance operation single row operations, Bulk operations. Single row … Read more

Hibernet first program

hibernate.cfg.xml

Employee.hbm.xml

Employee.java

EmpInsert.java

Whenever this program get compiled and run this application as simple java application run same this client application insert the records in database.

Components using hibernate based application

Pojo class. Hbm.xml file. Hibernate configuration . xml file. Client class of hibernate. Pojo class It is an ordinary java class having member variable.the pojo class will be mapped with table and member variable will be mapped with table columns in the process of o-r mapping.this class will used by hibernate client application to developed … Read more

Hibernate Architecture

Hibernate support all layer architecture single layer,2 layer,n layer High level architecture of Hibernate can be described as shown in following illustration. Hibernate configuration file In earlier version it was a properties file from hibernate 2.2x it is change if no file is explicitly specified it becomes a hibernate-cfg.xml file as the hibernate configuration file … Read more

Features of Hibernate

Transparent persistence without byte code processing Object-oriented query language Powerful object-oriented query language Full support for polymorphic queries New Criteria queries Native SQL queries Object / Relational mappings Three different O/R mapping strategies Multiple-objects to single-row mapping Polymorphic associations Bidirectional associations Automatic primary key generation Multiple synthetic key generation strategies Support for application assigned identifiers … Read more

Date range query on Timestamp field in HQL

Suppose we want to make query between two dates in a timestamp field for example We have a table colors to store different colors

Pojo class for color table is

Above class shows that addDate is timestamp field and we want to query it as date for that we have casted timestamp field … Read more