key « Query « JPA Q&A





1. HQL query to join 2 tables with the same key    stackoverflow.com

Hi everyone Iam trying to this in HQL: select A.a A.a1, B.b,B.b1 from A,B where A.x=B.x; It is simple to realize the join with sql but when returninig in HQL I find a problem. would ...

2. With Hibernate, how can I query a table and return a hashmap with key value pair id>name?    stackoverflow.com

I've got this table :

table name : Account
Fields : id (varchar), name(varchar), other fields...
I want to query this table with hibernate mechanism (to use the second cache level). The result ...

4. Querying w/Composit key    forum.hibernate.org

5. Howto query keys only    forum.hibernate.org

Hello Dirk, You can always select on the attribute of your object. I.e: Select object.id From MyObject object; This should return a list with your keys. When you select on multiple values a list of Object[] is returned, where Object[].length is equal to the attributes you selected. I.e.: select object.id, object.name from MyObject as object; returns a list with Object[] instances ...

6. Adding support for key-many-to-one in Criteria queries    forum.hibernate.org

Would it be simple to add some sort of error prevention code that restricts the API user from creating an alias or subquery to in a key-many-to-one relationship? There's no graceful handling of the API misuse--Hibernate just writes incorrect SQL and it is up to the API user to search through the forums to figure out why that happened. If someone ...

7. Mixed/wrong key used in join query    forum.hibernate.org

Hi, Im a noob using Hibernate 3.1, MySQL 5 and Java 5 I have 2 tables (cars and passengers) and 2 pojos (car and passenger). car has a 1-to-many association with passenger the car table has the following columns: id PK not null vin -a legacy PK, unique (vehicle identification number) the passenger table has the following columns: id pk not ...

8. Named query includes collection key column when executed    forum.hibernate.org

Hey there, I m trying to use a named query from an optional mapping file that declares the entities mappings and is referenced in a persistence.xml file. Everything works fine when I use annotations. However, when using a mapping file, named queries get warped. The entities are mapped fine. So are the collections. Everything reads fine during deployment. However, a simple ...

9. in clause with subquery on a class with multiple column key    forum.hibernate.org

Hi everybody, Here is my problem, I am trying to write a query like this : from MyClass cls where cls in (select cls2.cls from MyOtherClass) The problem is that MyClass has a multiple column key (key1,key2,key3) Because there are three elements that identifies my object of class MyClass. Now the issue: We are using MSSQL 2005 and the query that ...





10. Ordering on non-key column of contained object    forum.hibernate.org