Select « Load « JPA Q&A





1. Can I eager load a property using HQL?    stackoverflow.com

I'm trying to work out how to eager load the customers in the following HQL query:

select order.Customer
from Order as order
where order.Id in
(
  select itemId
  from BadItem as badItem
  ...

2. Lazy loading doesn't work - jpa    stackoverflow.com

Hy all, I have three tables Child, Pet and Toy. Pet has a reference key the child id, and a toy has a reference key to a dog id. ...

3. Hibernate Criteria restriction on a not loaded table    stackoverflow.com

I'm trying to have a Criteria query to have a restriction on an entity that isn't loaded. My mapping is all done via one-to-many relations. For example, I'm trying to get the ...

4. Grails - Criteria, exclusive selection    stackoverflow.com

I have a domain class containing a 1 to Many relationship. One CreditProvider can have Many Rates. I would like to select all the CreditProviders that was not rated today with a ...

5. High number of selects when loading a collection    forum.hibernate.org

Hello, I have a strange issue that I'm seeing. Granted it could very well be my understanding but here is what's going on. Say a 3 entity classes A, B, and C. Class A has a collection of class B's. Class B, is essentially a join table between A and C where the primary key of class B is a composite ...

6. Preserving selection criteria when lazy loading to-many    forum.hibernate.org

Sorry if this is documented, but I cannot even begin to compact this question into a sentence and searching didn't help. Here is the deal: I have a to-many table which has a field on which the query is based. When I lazy load the to-many relationship, all fields get lazy loaded and not just the one I based my selection ...

7. in the parent-child relation,when select child,why load pare    forum.hibernate.org

accoding the hibernate manual,write the parent-child xml mapping file, in the parent.hbm.xml,the set tag using the lazy property . when using the session.find(query,object[],type[]) to select the child object, watching the logging,it display that hibernate also select the parent record,if so,if child has foreign relation with other table ,it will load these record?I think it should avoid,but I don't how to do ...

8. load a graph with a fixed nb of select    forum.hibernate.org

Hi, I would like to know how it is possible to load a graph (depth = 4) with a fixed number of select. Could you help me please ? I have 4 tables A, B, C and D (A has a set of Bs, B has a set of Cs and C has a set of Ds). All collections are bidirectionnal ...

9. Instatiating with SELECT NEW, but i need to load an object    forum.hibernate.org

Hi all! Im having problem on doing this: select new local(s.name, s.address, s) from store s where s.region = 10; However, when the constructor is initialized, the parameter s comes with its fields not loaded, example, s.name = null, s.address = null, and all other fileds comes with null, although s.name and s.address come OK at the constructor. Question: anyone knows ...





10. Select new User(... with load List)    forum.hibernate.org

Hibernate version: 2.1.7 Name and version of the database you are using: Oracle9i Hi all again, I Have a User and yours documents, like this: Code: public class User implements Serializable { /** idUser attribute */ private Long idUser; /** name attribute */ private String ...

11. fetch=join Object Graph Loaded Wrong Yet fetch=select Works    forum.hibernate.org

I am attempting to load a ScheduledContentPackage . Its parent, ContentPackage, has a collection of Assets. These assets are not loaded as expected with fetch="join". Yet they are with fetch="select". Instead of adding each Asset to ContentPackage's Asset collection, Hibernate creates N instances of ScheduledContentPackage, where N is the number of child Assets joined onto ContentPackage. Using MySql Hibernate version: 3 ...