Case-insensitive search using Hibernate Query Language(HQL).

Case-insensitive search using Hibernate Query Language(HQL).

What is Case-insensitive search using Hibernate Query Language?

View Answers

May 31, 2012 at 6:42 PM

The Hibernate Query Language, (HQL) similar to SQL designed, having some features of Object oriented concepts. It provides the bridge between your database to your application. Here is one example of case insensitive search.

package net.roseindia.main;

import java.util.*;
import net.roseindia.table.Employee;
import net.roseindia.util.ConnectionUtil;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;

public class CaseInsensitiveHQL {
    public static void main(String[] args) {
        SessionFactory sessionFactory = ConnectionUtil.getSessionFactory();
        Session session = sessionFactory.openSession();
        String hql="SELECT emp from Employee emp WHERE emp.name='Ron'";
        Query query=session.createQuery(hql);
        Iterator it=query.iterate();
        while ( it.hasNext()) {
            Employee employee = (Employee) it.next();
            System.out.println(employee.getName());
            System.out.println("Salary : "+employee.getSalary());
        }
        session.close();
    }
}

Description: Here we are printing name and salary of employee whose name matches to ?Ron? .HQL looks like SQL.Its query is case-insensitive expect we are using the java class and properties.

Ads









Related Tutorials/Questions & Answers:
Case-insensitive search using Hibernate Query Language(HQL).
Case-insensitive search using Hibernate Query Language(HQL).  What is Case-insensitive search using Hibernate Query Language
Hibernate Criteria Case Insensitive Search.
Hibernate Criteria Case Insensitive Search.  How to use Case Insensitive Search in Hibernate?   The Case Insensitive ignores the case... as alternative to HQL. The Criteria interface can be obtained using
Advertisements
Case-insensitive ordering using Hibernate Criteria.
Case-insensitive ordering using Hibernate Criteria.  What is Case-insensitive ordering in Hibernate Criteria
Case-insensitive equals using Hibernate Criteria.
Case-insensitive equals using Hibernate Criteria.  How to use Case-insensitive equals with Hibernate Criteria?   The Case Insensitive ignores the case of the latter. It Selects all the records of the table related
What is Hibernate Query Language (HQL)?
What is Hibernate Query Language (HQL)?  Hi, What is Hibernate Query Language (HQL)? thanks
HQL, Hibernate Query Language
HQL - Hibernate Query Language In this tutorial on HQL we will learn how...? The HQL stands for Hibernate Query Language, which is inspired by the SQL... columns. But in case of HQL we write queries using the persistence object
Introduction To Hibernate Query Language (HQL)
Introduction To Hibernate Query Language (HQL) In this tutorial you will learn about Hibernate Query Language. HQL is an abbreviation of Hibernate Query... as roseindia.net.Hibernateexample. Benefits of Hibernate Query Language is : Learning (HQL) Query
Hibernate Query Language
Hibernate Query Language           Introduction to Hibernate Query Language Hibernate Query Language or HQL for short is extremely powerful query language. HQL
Hibernate HQL query by using like operator.
Hibernate HQL query by using like operator.  How use like operator in HQL?   HQL stands for Hibernate Query Language, provided by Hibernate... = sessionFactory.openSession(); String hql="SELECT emp.name, emp.salary, emp.dateOfJoin
Hibernate Criteria Case Insensitive
Hibernate Criteria Case Insensitive The Case Insensitive ignores the case... = criteria.list(); An example of Case insensitive is given below please consider... as shown below: Hibernate: select this_.roll_no as roll1_0_0
HQL in hibernate ? Explain the use of HQL.
like SQL.Its query is case-insensitive expect we are using the java class...HQL in hibernate ? Explain the use of HQL.  What is the HQL in hibernate ? Explain the use of HQL.   HQL stands for Hibernate Query
Hibernate Query Language
to Hibernate Query Language Hibernate Query Language or HQL for short is extremely powerful query language. HQL is much like SQL and are case...Hibernate Query Language      
Delete Query using HQL
Delete Query using HQL  Can we write 'AND' with 'WHERE' clause in delete query using HQL? For example: delete from table name where field1... a look at the following link: Hibernate Delete Query
Hibernate Query Language
Hibernate Query Language   Explain Hibernate Query Language(HQL) of Hibernate?   Hi Samar, Hibernate Query Language is a library.... Compared with SQL, however, HQL is fully object-oriented and understands notions
HQL Query
HQL Query  Hibernate query language: How to use a left join in Hibernate query language. Can somebody help with an example. I am getting a unexpected token error in HQL Query tool If I use joins
Examples of Hibernate Criteria Query
Criteria Query: HQL - Hibernate Query Language Hibernate criteria avg... queries. The Hibernate query Language can be used easily to perform Add, Update..., HQL Select Example, HQL Select Query Hibernate Tutorials: Hibernate
HQL query
HQL query  how to select only password based on username using HQL query from login table where uname and paswrd are two column names
select query using hibernate
select query using hibernate  Hi, can any one tell me to select records from table using hibernate. Thanks   Please visit the following link: Hibernate Tutorials The above link will provide you different
indexof case insensitive java
indexof case insensitive java  Hi, I have to use the indexOf function on String class in Java. I am looking for indexof case insensitive java example. Share the code with me. Thanks   Hi, You can convert both
HQL Sample
technical stuff very easily. The HQL or Hibernate Query language is very powerful and can be easily used to develop complex query in Java program. HQL is then translated into SQL by the ORM component of Hibernate. HQL is very powerful
HQL
HQL  What is the HQL in hibernate ? Explain the use of HQL.   Hi Friend, Please visit on this link....... Hibernate Query Language
Hibernate criteria query using Max()
Hibernate criteria query using Max()  What is Hibernate criteria query using Max()?   You can find out maximum value in hibernate criteria by using projection. Projection is an interface and a class
Hibernate criteria query using avg()
Hibernate criteria query using avg()  How to calculate average in Hibernate criteria query using Projection?   You can calculate average of any numeric values in hibernate criteria by using projection. Projection
Hibernate criteria query using Min().
Hibernate criteria query using Min().  How to find minimum value in Hibernate criteria query using Projection?   You can find out minimum value in hibernate criteria by using projection. Projection is an interface
HQL Query in execute method of Struts2
data from database using hql. And where I need to write the hql query...HQL Query in execute method of Struts2  I am making login page in struts2 and using hibernate . Now I wants to pull user name and password from
ModuleNotFoundError: No module named 'case_insensitive_dict'
ModuleNotFoundError: No module named 'case_insensitive_dict'  Hi...: No module named 'case_insensitive_dict' How to remove the ModuleNotFoundError: No module named 'case_insensitive_dict' error? Thanks   Hi
ModuleNotFoundError: No module named 'case_insensitive_dict'
ModuleNotFoundError: No module named 'case_insensitive_dict'  Hi...: No module named 'case_insensitive_dict' How to remove the ModuleNotFoundError: No module named 'case_insensitive_dict' error? Thanks   Hi
Hibernate delete Query
Hibernate delete Query In this tutorial you will learn how to use HQL delete query in Hibernate. In this section we are discussing about the HQL delete query... to use HQL delete query. An example is being given regarding how delete query may
sum and avg function using HQL.
sum and avg function using HQL.  How to use sum and avg function in HQL?   HQL supports many aggregate functions. Sum and avg are some...(emp.salary) FROM Employee emp"; Query sumQuery = session.createQuery
ModuleNotFoundError: No module named 'odoo10-addon-auth-user-case-insensitive'
ModuleNotFoundError: No module named 'odoo10-addon-auth-user-case-insensitive...: ModuleNotFoundError: No module named 'odoo10-addon-auth-user-case-insensitive' How...-case-insensitive' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'odoo12-addon-auth-user-case-insensitive'
ModuleNotFoundError: No module named 'odoo12-addon-auth-user-case-insensitive...: ModuleNotFoundError: No module named 'odoo12-addon-auth-user-case-insensitive' How...-case-insensitive' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'odoo13-addon-auth-user-case-insensitive'
ModuleNotFoundError: No module named 'odoo13-addon-auth-user-case-insensitive...: ModuleNotFoundError: No module named 'odoo13-addon-auth-user-case-insensitive' How...-case-insensitive' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'odoo11-addon-auth-user-case-insensitive'
ModuleNotFoundError: No module named 'odoo11-addon-auth-user-case-insensitive...: ModuleNotFoundError: No module named 'odoo11-addon-auth-user-case-insensitive' How...-case-insensitive' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'odoo12-addon-auth-user-case-insensitive'
ModuleNotFoundError: No module named 'odoo12-addon-auth-user-case-insensitive...: ModuleNotFoundError: No module named 'odoo12-addon-auth-user-case-insensitive' How...-case-insensitive' error? Thanks   Hi, In your python
Using Min, Max and Count on HQL.
Using Min, Max and Count on HQL.  How to use Min, Max and Count on HQL
How to get unique list in Hibernate using Criteria Query?
How to get unique list in Hibernate using Criteria Query?  Hi, Share me the example code for getting Unique List in Hibernate through Criteria Query? Thanks
Hibernate Query Language
In this Tutorial we are going to discuss HQL with example
Hibernate Named Native SQL Query using XML Mapping
In this section, you will learn Named Native SQL Query using XML Mapping in Hibernate with an example
Hibernate Named HQL using XML Mapping
In this section, you will learn executing Named HQL written in XML Mapping file
Hibernate Search
Hibernate Search  Where to learn Hibernate Search module? Thanks   Hi, Check the tutorial: Hibernate Search - Complete tutorial on Hibernate Search Thanks
Hibernate: ORDER BY using Criteria API.
API is an alternative of HQL (Hibernate Query Language) queries. It is more...Hibernate: ORDER BY using Criteria API.  How to display record in order using Criteria API?   Hibernate Criteria API provides an easy way
HQL Update Statement to update database table
objects and their properties. Hibernate query language (HQL) also supports WHERE...HQL Update Statement to update database table HQL's update query statement is used to update the values of database rows. Though HQL is similar to SQL
Hibernate Tutorial Roseindia
class HQL from Clause Example Hibernate Count Query... language. Roseindia Hibernate tutorials includes all the aspects of hibernate..., HQL , criteria , transaction, tips and performance. The online hibernate examples
Hibernate insert Query
Hibernate insert Query In this tutorial you will learn about how to use HQL insert query. INSERT query in HQL is used to insert the records into the database table. INSERT query of HQL is just like the INSERT query used in SQL
Complete Hibernate 3.0 and Hibernate 4 Tutorial
. The Hibernate Query Language, designed as a "minimal" object-oriented...; ADS4ThUnitADS Hibernate Query Language Introduction to Hibernate Query Language In this lesson you will learn about
Criteria Query Examples in Hibernate
Criteria Query Examples in Hibernate  How to use the Criteria Query in Hibernate? How to select the data using Criteria Query of Hibernate? Thanks... Criteria Query in Hibernate with Examples code. Check the tutorial Criteria Query
sql query search function
sql query search function  i have a textbox on a form , i like a search a data in the form, when i give whatever name and id or etc..its will search and show the same form , so help me using jsp
hibernate query
hibernate query  hibernate apache par kam karta hai kya   Hi Friend, Yes. Thanks
hibernate delete query :
hibernate delete query :   Hi, I m using Hibernate 3 + javadb my... APP.BIDS where BID_ID = 16"; Query query = session.createQuery(query1); int row... org.hibernate.hql.ast.QueryTranslatorImpl - parse() - HQL: delete from APP.BIDS
Hibernate Criteria Query Example Program
;In the Hibernate Criteria Query Example You will find the source code of using Criteria...Hibernate Criteria Query Example Program  Hi, I am new in Hibernate and learning the Criteria Query. How to use the Hibernate Criteria Query in my

Ads