hql « Search « JPA Q&A





1. whats wrong with this simple HQL syntax?    stackoverflow.com

Hi i am trying to execute this simple HQL query to get a list of files from my database using:

private static final String SQL_GET_FILE_LIST = "select filename, size, id, type from ...

2. Many to many search using HQL    forum.hibernate.org

Newbie Joined: Tue Jul 13, 2010 9:31 am Posts: 1 As I could not find a way to perform searches on objects with many to many relations using Criteria API/Example, I came up with Example like HQL solution (pretty much untested): Code: public Collection search(Session session, Object entity) throws Exception { ...

3. beginswith and endswith search in HQL    forum.hibernate.org

4. HQL Search    forum.hibernate.org

Is there a way to run an HQL query or Hibernate criteria query that would allow me to search for a string in every persisted attribute of a class? For example, imagine I have a class Project This class has attributes name, location, description. An HQL query string like this Code: String hqlString = "FROM Project as p where p.description like ...

5. Getting started with HQL - searching sets    forum.hibernate.org

I am moving from Criteria to HQL and enjoying the process, but have a a question. I have a class "Person" with a one-to-many set of objects "Metadata". Metadata are simple objects; they only have a String key and a String value. I would like to use HQL to query for person objects based on multiple metadata constraints. For example, I ...