hql « Key « JPA Q&A





1. HQL : Getting the primary key of an object    stackoverflow.com

I am using HQL to save an object in the DB. It is something like this

Query query = sessionFactory.getCurrentSession().createQuery(ASK_FOR_HELP_SAVE_QUERY);
        query.setInteger("status", askForHelp.getStatus());
   ...

2. Minimum and primary key in Single HQL    stackoverflow.com

Can I get the minimum value for a column and associated primary key in HQL or using Hibernate/JPA Criteria?

3. Newbie: HQL - How to access the "primary keys" ...    forum.hibernate.org

Hi, I've got a table "Sflight" with 3 primary keys: carrid, connid, fldate. carrid + connid are foreign keys on "Spfli". My problem is, that I don't know how to efficiently use the HQL to query for example a single "Sflight" object (when I only have the 3 foreigen-key values for querying). My hql query string looks like this: Select sf ...

4. HQL - foreign key    forum.hibernate.org

Hello, I hope s.o. can help me. How is it possible with a HQL-statement to say the where-clause, that it should look after the foreign key? My case: Entities: Teil and Disponent in Teil is the key from Disponent. Now I want this: "select teilId from Teil where disponentId like ?" But I don't know how to write "disponentId". In my ...