Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



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

Have Programming Question? Ask it here!
 
 
 


ratna rathor
Case-insensitive search using Hibernate Query Language(HQL).
1 Answer(s)      2 years and a month ago
Posted in : Hibernate


What is Case-insensitive search using Hibernate Query Language?


Advertisement
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.



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
Hibernate Query Language (HQL)
Hibernate Query Language (HQL)  What is Hibernate Query Language (HQL)?   HQL is much like SQL and are case-insensitive, except for the names of the Java Classes and properties. Hibernate Query Language is used
Hibernate Query Language
; Hibernate Query Language or HQL for short is extremely powerful query language. HQL is much like SQL  and are case-insensitive, except...).   Understanding HQL Syntax Any Hibernate Query Language may consist
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 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
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
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 HQL query - Hibernate
Delete HQL query  Hi I am trying hibernate tutorial. But delete HQL tutorial not working properly. It gives null pointer exception. Query class has method executeUpate() & not executeUpdate(); log4j:WARN No appenders
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
on hibernate query language - Hibernate
on hibernate query language  Display the contents of 2 fields in a table in a single column using SQL statement.Thanks!  Hi friend,read for more information,http://www.roseindia.net/hibernate
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
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 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
Hibernate Training
. How to use HQL (Hibernate Query Language) for querying objects...; Hibernate Query Language... Learning Fundamentals of  Hibernate by using the Hibernate persistence
Hibernate delete HQL - Hibernate
Hibernate delete HQL  Hi I am trying hibernate tutorial. But delete HQL tutorial not working properly. It gives null pointer exception. Query class has method executeUpate() & not executeUpdate
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
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-HQL subquery - Hibernate
Hibernate-HQL subquery  Hi, I need to fetch latest 5 records from a table.My query goes here. select * from (select * from STATUS...) where ROWNUM <=5; -------------------------- I need an equivalent query
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
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 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
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 Query Language
In this Tutorial we are going to discuss HQL with example
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
Hibernate Search
: Hibernate search automatically updates and manages the Lucene Index by using... Hibernate Search       In this section we will learn about Hibernate Search, which is used create
Hibernate Search
Hibernate Search  Where to learn Hibernate Search module? Thanks   Hi, Check the tutorial: Hibernate Search - Complete tutorial on Hibernate Search Thanks
Hibernate query - Hibernate Interview Questions
Hibernate query  Hi,In my one interview i face one question that is how to write query without using hql and sql.If any body knows please give the answer thank u
Using Min, Max and Count on HQL.
Using Min, Max and Count on HQL.  How to use Min, Max and Count on HQL
Hibernate Tools
Hibernate Tools       Working with Hibernate is very easy and developers enjoy using the APIs and the query language. Even creating mapping metadata
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
Hibernate Query  Hibernate Query
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 Search - Hibernate
topics... these dayes i am working in "Hibernate Search" it is new and i can't... and offcourse to others who are new and want to integrate Hibernate Search... which leads me to integrate the Hibernate search in my exsisting hibernate
search query - SQL
. i have to search? how to do query for this? any one can help me...search query  hi anyone can help me? i have four textfield...) 4)Age From and Age to ((drop down list box) i have to search the result
delete query problem - Hibernate
'"; Query query = sess.createQuery(hql) query.executeUpate(); // int row..., String hql = "delete from Insurance insurance where id = 2"; Query query = sess.createQuery(hql); int row = query.executeUpdate
Hibernate Named HQL using XML Mapping
In this section, you will learn executing Named HQL written in XML Mapping file
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 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 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
hibernate query
hibernate query  hibernate apache par kam karta hai kya   Hi Friend, Yes. Thanks
 

 

 

DMCA.com