find « Load « JPA Q&A





1. ClassLoader getResources doesn't find all versions of the file    stackoverflow.com

We have a issue where we are trying to merge persistence.xml files from multiple JAR's

Thread.currentThread().getContextClassLoader().getResources(PERSISTENCE_XML)
Does return a list of all persistenc.xml files from all projects, however when we make JAR files ...

2. Is there a way to find the load time of Hibernate?    stackoverflow.com

I want to make a loading screen(Splash screen) for my Java SE app. And I am using Hibernate to as the ORM. The session factory creation takes sometime and I would ...

3. EntityManager.find eagerly loading all relationships    forum.hibernate.org

Well, digging it, I found that Hibernate does not load the relationships, they are lazy for sure, but, the initial query joins the tables anyway, which is bothering me (and will bother the DBA for sure) Here's the output of em.find(AbstractMedia.class, id) Code: select abstractme0_.ID as ID4_4_, abstractme0_.DELETED as DELETED4_4_, abstractme0_.MEDIA_HASH as MEDIA4_4_4_, abstractme0_.FOLDER_ID as FOLDER7_4_4_, abstractme0_.SHARED as SHARED4_4_, abstractme0_.TITLE as ...

4. Finding which PU or session an entity was loaded from    forum.hibernate.org

Is it possible for an entity to determine which persistence-unit (or session) it was loaded from? I wrote routines to maintain an "audit trail" of all changes to entities, and they work great. However I want to ensure that they use the same persistence unit to save the audit trail, so that the audit tables and main entity tables are committed/rolled ...

5. finding certain files in a jar using ClassLoader.getResource    forum.hibernate.org

I've built a Java/Hibernate/Swing standalone app that works great when executed from within Eclipse. I created a runnable jar, in which the GUI part worked but the app stalled when the "DoIt" JButton was clicked. After a great deal of googling I have a vague understanding that the problem lies with classloaders, and that one solution is to use ClassLoader.getResource() and/or ...

6. joined-subclass, polymorphism and load() and find()    forum.hibernate.org

Newbie Joined: Wed Oct 15, 2003 11:16 am Posts: 6 I have a classic parent-child model in a single table based on a parent_id foreign key. Some nodes may have additional attributes based on a joined-subclass mapping. The base class is CatalogNode, and the joined-subclass is Product. The Product attributes are in a separate table, with the same primary key as ...

7. Session.load() or Session.find() for existence    forum.hibernate.org

I think it is because find() does not throw exception in the case when object with given ID does not exist. Of course, you can catch exception and handle it appropriately, but "appropriately" here means: "If the Session throws an exception (including any SQLException), you should immediately rollback the transaction, call Session.close() and discard the Session instance." (7.9.4. Exception handling) PS: ...

8. performance related questions in find/load/get    forum.hibernate.org

Please allow me to ask these basic questions in the search functions with a with performance perspective. I understand the basic differences between the methods find(), load(), and get() (which is the upfront knowledge of the id). Thinkng of performance, I have these questions: 1. Does find() do the same as that of load() in terms of locking the tables in ...

9. Proper use of Session get,load and find    forum.hibernate.org

Hi, I know in some variations this question have been raised, but reading the doc and various posts I can't be sure when is each method is properly used. Can you please elaborate on the each method semantics? (like why can't I use get instead of find to check if the object exists etc.) Thanks a lot.





10. Difference between get load and find    forum.hibernate.org

This is what I understand from the documentation: "If you are not certain that a matching row exists, you should use get() method, which hits the database immediately....". get() - always goes to the database load() - can use a proxy / cached object. If I want to test if a particular object exists in the database, should I use: find() ...

11. outer join fetching load() vs find()    forum.hibernate.org

Dear hibernaters, I have a table (USER_EVENT) with many-to-one relationships to some dictionaries. I want to load all records from this table along with the dictionary values. The straightforward: List eventList = session.find("from UserEvent"); does not use outer joins and does one query for each dictionary value. On the other hand, session.load(UserEvent.class, new Long(900)); does use outer joins which confirms that ...

13. When making a find to an object it loads all its collections    forum.hibernate.org

Author Message daragut Post subject: When making a find to an object it loads all its collections Posted: Mon Jan 17, 2005 7:10 am Newbie Joined: Mon Jan 17, 2005 6:12 am Posts: 1 Location: Spain Hibernate version: 2.0.3 Mapping documents: hibernate.cfg.xml true ...

15. Finding the original object loaded from dbase by hibernate    forum.hibernate.org

Hi All, I could not find any documentation related to this. We are migrating an existing Toplink application to hibernate. In the current application once we read any persisted object from the database through Toplink (which makes a backup of read object and refers to it as original Object). The persisted object is cloned and given to the calling application. The ...

16. Find versus Load    forum.hibernate.org





17. Entity loaded twice when calling em.find(entityId) correct?    forum.hibernate.org

Page 1 of 1 [ 1 post ] Previous topic | Next topic Author Message JohnRock Post subject: Entity loaded twice when calling em.find(entityId) correct? Posted: Thu Mar 19, 2009 4:39 am Beginner Joined: Sat Feb 07, 2009 4:08 pm Posts: 22 Location: New York City When I call a find() ...