How to solve QuerySyntaxException (table is not mapped) in hibetnate? Author : JavaBeat Date : Mon Dec 1st, 2008
The above QuerySyntaxException is thrown when we are not mapping the table name properly. The first time hibernate users
can be seen this error because you will map the table name directly in the query. That will not work in the hibernate. You will have to
map the class name that is mapped in the Hibernate configuration file. Look into the following example:
Pagination using Hibernate and JSP Author : AbhiVuyyuru Date : Fri Oct 3rd, 2008
In the past, I had a few posts on how to implement pagination using displaytag(1, 2). That solution is feasible only with small result sets, the reason being that we will have the entire result set in memory (also called cache based paging). 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, is that there will be multiple calls to the database for multiple page requests.
Configure MySql database with Hibernate mappings Author : JavaBeat Date : Tue Jul 29th, 2008
Configuring MySql database with hibernate is the same as with other databasses.The only difference will be connection url and the database dialect to be specified in the configuration file. This tips provides a basic example configuration file for configuaring the MySql with hibernate. But it doesnot explain you installing the MySql database.
Collection Mapping in Hibernate : one-to-many Author : JavaBeat Date : Tue Jul 29th, 2008
This article explains how to map two classes in collection mapping. In this example one Author object has the list of
Book objects. Both the classes are mapped and will be inserted together into the database. Here this example uses Bag as the
collection type. Other collection types available are Set,List,Array. Look into the example programs for more detail.
Comparison operators in Hibernate Author : JavaBeat Date : Sat Jul 26th, 2008
HQL supports all the operators used in the SQL language. But, Criteria API doesn't support the
arithmetic expressions. Apart from that, it is easy to use other operators in the Criteria API itself.
This tips provides few basic example programs on using the operators.
NULL and NOT NULL comparison in the Hibernate API Author : JavaBeat Date : Sat Jul 26th, 2008
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.
How to use named parameters and named query in Hibernate? Author : JavaBeat Date : Sat Jul 26th, 2008
There is two types of query parameters binding in the Hibernate Query. One is positioned parameter and
another one is named parameters. But, hibernate recommend to use the named parameters since it is
more flexible and powerful compare to the positioned parameter.
Pagination in Hibernate Query API Author : JavaBeat Date : Sat Jul 26th, 2008
Pagination is the very common problem for the most of the eneterprise applications.
When we are retrieving thousands of records from the database, it is not good idea to retrieve
all the records at the same time. So, we have to implement some sort of pagination concept in your application
to restrict the number of rows to be fetched from the database.