hql « Association « JPA Q&A





1. Join without association in HQL    stackoverflow.com

Lets say I have two tables(A, B) like:

A {id, a, c}
B {id, b, c}
I have also their entities. I want to write an HQL so that the result set will be ...

2. Is it possible to bulk delete from a many-many association with HQL?    stackoverflow.com

And if so, what is the syntax? Assume that I want an instance of Foo to be unassociated from all instances of Bar: In SQL it would simply be:

delete from FOO_BAR_MAPPING
where FOO_ID = ...

3. HQL - can i join when the association is backwards?    stackoverflow.com

I have:

class A
{
    B b;
}

class B
{
}
I know i can do this:
from A a
join a.b b
but what I need to do is this (pseudo-HQL, it doesn't parse, hence this ...

4. How to join 2 tables in HOL without direct associations?    stackoverflow.com

I have 4 tables,they are A,B,C,D. A table data are Aid,name. B table data are Bid,course,Aid,studid. C table data are Cid,address. D table data are Did,class,studid. Here i need a new table which contains name,course,studid howc can ...

5. HQL- qiery intersections on set associations?    forum.hibernate.org

Newbie Joined: Wed Mar 17, 2004 6:47 pm Posts: 1 I'm using Hibernate 2.1 on Postgres 7.3.2. I've got an object with a fairly simple set property- a "Task" (my object) has any number of "AssignmentGroups" (strings) associated with it. What I'm trying to do is, given a Collection of AssignmentGroup names, get all the Tasks that match any of them. ...

6. HQl and associations    forum.hibernate.org

I have a customer table and a phone number table. A customer could have more than one phone number (home, mobile, work, evening etc..) and the Hibernate mapping files are set to bi-direcdtional 1 to many association. For a given customer first name and the phone type (say "mobile"), I would like the hql to return a List of customers with ...

7. HQL join through association table    forum.hibernate.org

I have 3 tables: person, certification, pers_cert_assoc where person is associated to certification via the pers_cert_assoc. I would like to use hql to select a set of persons who have a specific certification. Here's my sql select person.* from person, pers_cert_assoc, certification where person.id = pers_cert_assoc.person_id AND pers_cert_assoc.cert_id = certification.id AND certification.type = "HQL Cert"; All tables have hbm.xml mappings with ...

8. hql on a many to many association    forum.hibernate.org

I have entity Student and Course, in a many-to-many association. The linking entity is Payment. All this entity has surrogated id as primary key. I want to get all the students that are not associated to a specific course. How to do it in HQL? I tried something like select s from Student s, Course c, Payment p where c = ...

9. HQL on many-to-many association    forum.hibernate.org

I am trying to model a many-to-many relationship with a composite element and a many-to-one tag. I was not able to frame the HQL to do the same. Any help is highly appreciated. Hibernate version: 3.0 Mapping documents: The mapping for Tour:





10. Help with association HQL statement    forum.hibernate.org

11. HQL for association    forum.hibernate.org

Hello, I'm facing an issue in HQL. I've Person bean and Set of Address bean inside it. Person contains a field externalZipCode. Address bean contains a field zipCode. I want to get List of Person if either Person.externalZipCode = 94102 or Address.zipCode = 94102 My HQL goes like this - --------HQL------ from Person p left join p.address as ad where p.externalZipCode ...

12. HQL issue with Criteria and association    forum.hibernate.org

Hi I am a newbie to Hibernate trying to create an integrated JSF/Spring/Hibernate app. My mapping file is: Code: ...