list « Load « JPA Q&A





1. Update one value from a list of dependent objects    stackoverflow.com

Given an entity with a list of components:

class Entity{
    Long id;
    String name;
    List<Component> components = new ArrayList<Component>();
}
class Component{ Object value; }
Configuration: ...

2. Books and resources for Java Performance tuning - when working with databases, huge lists    stackoverflow.com

I am relatively new to working on huge applications in Java. I am working on a Java web service which is pretty heavily used by various clients. The service basically queries ...

3. How to add a product in a list without loading all the database?    stackoverflow.com

In my domain model I have a bi-directionnel association between the ProductList entity and the Product entity with the following hibernate mapping :

@Entity @Indexed
@Table(name="product_list")
public class ProductList {

@ManyToMany(fetch=FetchType.LAZY)
@JoinTable(name = "list_items",
   ...

4. loading objects from a list of composite-ids in nhibernate    stackoverflow.com

what i want to do is to build an HQL Query which accepts a list of ids and returns a list of loaded objets. After a while, i found that something ...

5. Hibernate - load a collection for each entity in a list    stackoverflow.com

I'm in a non-lazy-loaded Hibernate project, and I'd like to load a list of entities, along with a certain collection path for each object. What's the best way of doing that? Is ...

6. Loading part of a List with JPA    coderanch.com

Hello. I'm using JPA (Hibernate implementation). I've got a bean that has a List of beans and I want to load this list of beans. Obviously I'd like not to load the whole list to memory at a time but to load the first elements, use them, free memory, load the next elements and so on. I know I can do ...

7. Loading a list of objects by id    forum.hibernate.org

Hi, I'm currently using a Sphinx search engine to search through some rows in a table. This then returns a list of 20 ids to be shown on my listings page. What I'd like to be able to do is use Hibernate to return the full objects for these ids. Many of the the more popular objects will be stored in ...

8. Eager loading of list properties    forum.hibernate.org

Hi, I played around with eager loading in order to tune the performance. I used 'join fetch' in hql/criteria for loading some properties eagerly. This works quite fine. My problem is, that I want to avoid to have a cartesian product for collections. A sample: Class A { B b; List c; } Class B { } Class C { D ...

9. I Can't load object ,But can list.get(0) the same object!?    forum.hibernate.org

Hibernate: select trade0_.trade_id as trade_id0_, trade0_.trade_name as trade_name0_, trade0_.trade_desc as trade_desc0_ from trade trade0_ where trade0_.trade_id=? java.lang.ClassCastException at net.sf.hibernate.type.IntegerType.set(IntegerType.java:31) at net.sf.hibernate.type.NullableType.nullSafeSet(NullableType.java:48) at net.sf.hibernate.type.NullableType.nullSafeSet(NullableType.java:35) at net.sf.hibernate.loader.Loader.bindPositionalParameters(Loader.java:674) at net.sf.hibernate.loader.Loader.prepareQueryStatement(Loader.java:713) at net.sf.hibernate.loader.Loader.doQuery(Loader.java:185) at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133) at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:831) at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:851) at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:57) at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:49) at net.sf.hibernate.persister.EntityPersister.load(EntityPersister.java:419) at net.sf.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:2081) at net.sf.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:1955) at net.sf.hibernate.impl.SessionImpl.load(SessionImpl.java:1884) at com.vcs.china.poweracl.extension.HiberTest.main(HiberTest.java:44) Exception in thread "main"





10. a class loading problem encountered in caing Criteria.list()    forum.hibernate.org

Hi, When we call Criteria.list to retrieve a bunch of persistent objects, we encounter a class loading problem. Basically hibernate is using the class loader that loads itself to load the persistent class, however, the class loader that load hibernate doesn't know about the persistent class, so we got a "class not found". Is there a way to direct hibernate which ...

11. getting list by loop/load vs. in(..)    forum.hibernate.org

Hello all! in case i get an array of object id's, will it be true to say that retrieving those objects with hql using select.. where.. in(list of ids) is the same as looping on those ids and getting each one of them with load() ??? i think maybe even the loop/load option is better.. what do you say?

12. Table list on page and lazy loading    forum.hibernate.org

I have a certain graph of objects, which can be very complex -object contains several children objects and they also contain their children objects, etc. I need to render a list of such objects on page. List can be relitivly long, and I think lazy initialization is not appropriate for this, since it will hit the database N*M-times,for each item in ...

13. Automatic Update on list loading    forum.hibernate.org

Hibernate version:3 I have a Hibernate object that contains other objects. When the Hibernate object is loaded it is causing an update to the database to occur which is causing some other problems. When the hibernate object is loaded one of the objects may or not be allowed to be viewed by the user. This is determined by another query. We ...

14. hydrate a list of objects during a load from the database    forum.hibernate.org

Hello everybody, This is my first attempt at using hibernate (3.2) and I am running into an issue with many-to-many associations. I have a desktop application and its interaction to the database only happens when the user saves and exits or loads from the database when the application is booted up. There is no retrieving/saving of data on a page-by-page basis. ...

15. lazy-loading of list returned by session.createQuery().list(    forum.hibernate.org

Hello. I use Hibernate Core 3.2.1. All my entities and collections have lazy loading. I have something like : String hql = "from WorkStage ws order by ws.no "; Query query = session.createQuery(hql); List listWorkStages = query.list(); Hibernate loads all records from table associtated with WorkStage class. What I want is to have lazy loading for this kind of list (listWorkStages). ...

16. Multiple load() or list() calls don't always populate data    forum.hibernate.org

Hibernate Version 3.3.1.GA I can reproduce this error in or out of a J2EE container and with various database implementations (Intersystems Cache, Oracle, or Derby), so I don't think they are associated with the problem. The issue is while under the same Session, we call session.load() or crtieria.list() for the same entities multiple times. In other words, we load the same ...