Introduction Hibernate is designed to be used with a large set of databases. The details of those databases are configured in an XML file called hibernate.cfg.xml. This configuration files could be given any name and is usually placed in the root of your application class path. There are many configuration parameters available that makes the …
Hibernate
How to solve QuerySyntaxException (table is not mapped) in hibetnate?
The following exception is very common if you are the beginner for hibernate. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 Exception in thread "main" org.hibernate.hql.ast.QuerySyntaxException: book is not mapped [from book] at org.hibernate.hql.ast.util.SessionFactoryHelper.requireClassPersister(SessionFactoryHelper.java:158) at org.hibernate.hql.ast.tree.FromElementFactory.addFromElement(FromElementFactory.java:87) at org.hibernate.hql.ast.tree.FromClause.addFromElement(FromClause.java:70) at org.hibernate.hql.ast.HqlSqlWalker.createFromElement(HqlSqlWalker.java:255) at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElement(HqlSqlBaseWalker.java:3056) …
Pagination using Hibernate and JSP
If the result set is large, then having the entire result set in memory will not be feasible. With large result sets, you cannot afford to have them in memory. In such case, you have to fetch a chunk of data at a time (query based paging). The down side of using query based paging, …
Difference between hibernate’s save,update and saveOrUpdate() methods
Difference between hibernate’s save,update and saveOrUpdate() methods Hibetnate has set of methods for saving and updating the values in the database. The methods look like same and difficult to differentiate between them if you are not understanding them clearly. If you understand the hibernate mechanism clearly, it doesn’t execute the SQL statements directly to manipulate …
NULL and NOT NULL comparison in the Hibernate API
null and not null check While checking for the null and not null values in the Hibernate API, we have to be careful and there is chance for misunderstanding. This tips explains how to compare the null values in the Hibernate query. also read: Introduction to Hibernate Hibernate Interview Questions Interceptors in Hibernate Hibernate Books …
How to use named parameters and named query in Hibernate?
Named Parameters in Hibernate Query There is two types of query parameters binding in the Hibernate Query. One is positioned parameter and another one is named parameter. But, hibernate recommend to use the named parameters since it is more flexible and powerful compare to the positioned parameter. Here we will look into the named parameter …
Three ways to create query in Hibernate
Create Query in Hibernate To create query in the Hibernate ORM framework, there is three different types. The following are the three ways to create query instance: session.createQuery() session.createSQLQuery() session.createCriteria() We will look into the details of each category in detail. also read: Introduction to Hibernate Hibernate Interview Questions Interceptors in Hibernate Hibernate Books session.createQuery() …
What is Hibernate Caching?
1. Introduction While working with Hibernate web applications we will face so many problems in its performance due to database traffic. That to when the database traffic is very heavy . Actually hibernate is well used just because of its high performance only. So some techniques are necessary to maintain its performance. Hibernate Caching is …