Welcome Message

Hi, welcome to my website. This is a place where you can get all the questions, puzzles, algorithms asked in interviews and their solutions. Feel free to contact me if you have any queries / suggestions and please leave your valuable comments.. Thanks for visiting -Pragya.

Showing posts with label Hibernate. Show all posts
Showing posts with label Hibernate. Show all posts

May 5, 2010

Features of Hibernate

* Hibernate 3.0 provides three full-featured query facilities: Hibernate Query Language, the newly enhanced Hibernate Criteria Query API, and enhanced support for queries expressed in the native SQL dialect of the database.

* Filters for working with temporal (historical), regional or permissioned data.

* Enhanced Criteria query API: with full support for projection/aggregation and subselects.

* Runtime performance monitoring: via JMX or local Java API, including a second-level cache browser.

* Eclipse support, including a suite of Eclipse plug-ins for working with Hibernate 3.0, including mapping editor, interactive query prototyping, schema reverse engineering tool.

* Hibernate is Free under LGPL: Hibernate can be used to develop/package and distribute the applications for free.

* Hibernate is Scalable: Hibernate is very performant and due to its dual-layer architecture can be used in the clustered environments.

* Less Development Time: Hibernate reduces the development timings as it supports inheritance, polymorphism, composition and the Java Collection framework.

* Automatic Key Generation: Hibernate supports the automatic generation of primary key for your.

* JDK 1.5 Enhancements: . While Hibernate3 still runs perfectly with JDK 1.2, Hibernate3 will make use of some new JDK features. JSR 175 annotations, for example, are a perfect fit for Hibernate metadata

* EJB3-style persistence operations: EJB3 defines the create() and merge() operations, which are slightly different to Hibernate's saveOrUpdate() and saveOrUpdateCopy() operations. Hibernate3 will support all four operations as methods of the Session interface.

* Hibernate XML binding enables data to be represented as XML and POJOs interchangeably.

* The EJB3 draft specification support for POJO persistence and annotations.

October 25, 2009

Hibernate related

Advantages :
1. Productivity : Persistence related code is very tough to write. Hibernate eliminates much of the grunt work.So we can utilize the effort we could have used in writing hand coded persistence logic.
2. Maintainability : In hand coded persistence, change in one of the object or relationship domain leads to change in other also. But hibernate provides us a buffer between the two midels, insultaing each model from minor changes in the other. Otherwise, most of the times, change needs to be made at the java side, which is thus prevented by using hibernate.
3. Performance : We can also optimize the existing hibernate code as per our requirements.Also, since hibernate provides automated persistence, it increases developer performance.
4. Vendor Independence : An ORM abstracts your application away from the underlying SQL databases and SQL dialect. If the tool supports a number of different databases, then this confers a certain level of portability on your application.

Persistence allows an object to outlice the process that created it. The state of the object may be stored to disk and an object with same state can be recreated.

problems with ORM that hibernate addresses:
1. Problem of Granularity : (Fine grained and coarse grained objects.)
2. Problem of identity : In java , identity can be defined by equals method or memory location and in DB, it is represented by primary key. Therefore,Identity should be something that should have no meaning to user.
3. Problem of association
4. Problem of subtyping
5. P of Object graph navigation.

for details refer page 10-15 chapter 1 of hibernate in action.