Submitted by heartin on Wed, 09/11/2013 - 11:09
Here we will see all the CRUD operations, and also object states and transitions in hibernate. CRUD operations are Create(save), Read(select), Update(update) and Delete(delete). We will see object states in hibernate such a new/transient, attached/persistent and detached.
Submitted by heartin on Wed, 09/11/2013 - 10:31
We will write a simple hibernate application to get started with hibernate.
Before starting, you should:
Submitted by heartin on Thu, 08/29/2013 - 08:06
Hibernate provide Criteria Queries as an object-oriented alternative to HQL. Criteria Query is used to modify the objects and provide restriction for the objects. Many complex queries in HQL or even SQL may become larger over a period of time and spread over many lines; and will be difficult to update and maintain. We have already seen HQL in www.javajee.com/introduction-to-hibernate-query-language-hql.
Submitted by heartin on Wed, 08/28/2013 - 10:09
We can have queries saved with a name and later we can retrieve them simply using that name. We use @NamedQuery annotation to declare a named query. We can also have a named query for native sql. For native SQL we use the annotation @NamedNativeQuery annotation. This is one of the important advantages of having a named query: you can write native SQL. You can retrieve a Query object from a saved query name (hql and native named query) using session.getNamedQuery method.
Submitted by heartin on Wed, 08/28/2013 - 09:02
Parameter binding is the process of binding a Java variable with an HQL statement. Using Parameter binding and not string concatenation for HQL statement creation will also guard against attacks like SQL injection.
Pages