ORM - Object Relation Mapping. Almost all contemporary databases are relational and based on SQL language. Most programs using them are created in an object way. So some kind of incoherence appears at the meeting point of a database and software. We need some appropriate tools to translate data from relational language into an object language and the other way round.
Service of JDBC is extremely troublesome while dealing with more complex applications.
ORM deals with following tasks:
Hibernate is currently one of the most popular ORM solutions.Its popularity and effectiveness were proved by the fact that e.g. implementation of CMP in EJB3 on JBoss server is based on Hibernate. What is more, a lot of solutions were copied during designing EJB3 specification.
Other, common solutions ORM include: CMP, JDO. Hibernate, as opposed to them, is not a standard but a concrete solution.
Its main advantage is:
- lightness � it is no need to use special containers, it is enough to attach an appropriate library. One can also use it to both: web and client applications. There is no need to generate manually an additional code. As opposed to e.g. JDO, Hibernate requires only presence of configuration files. Additional classes used by it are generated during performing a task.
Persistence
Meaning of the persistence is one of the most imporant thing in application development. Nowdays almost all applications require persistent data so it is very important for an system to preserve data entered by users even if the machine was powered off. Persistance in Java ( Hibernate ) is storing data in a relational databse using SQL.
Relational technology provides a way of sharing data among different aplications or among technologies that form part of the same application. Relational technology is a common denominator of many different technology platforms and systems so it is't specific to a particular application.
SQL in Hibernate
Relational technology provides a way of sharing data among different aplications or among technologies that form part of the same application. Relational technology is a common denominator of many different technology platforms and systems so it is't specific to a particular application.
SQL in Hibernate
SQL in Hibernate During working with an SQL database in a Java application , the Java code issues SQL statements to the databese using Java DataBase Connectivity API (JDBC). JDBC API is used to bind arguments to query parameters for example: to retrieve values from the result set. But these are low-level data access tasks, and what we really like to do is write code that saves and retrives complex objects, to and from the database.