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



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

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


ratna rathor
Case-insensitive search using Hibernate Query Language(HQL).
1 Answer(s)      2 years and 3 months 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
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
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
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
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
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
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-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
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
 

 

 

DMCA.com