TopLink Wiki

Main
About
Javadoc
Forum
Resources

RecentChanges
About Wiki
Find Pages
Page Index

Set your name in
UserPreferences

Edit this page


Referenced by
RefreshingQuery
RefreshingQueries




JSPWiki v2.0.52


RefreshObject


I need to refresh an object -- I know it's changed

Note

ReadAllQueries always go to the database. This therefore applies to ReadObjectQueries only.

Solution A: Refresh the Object

If you already have the object around, it's easiest to just refresh it. See Session.refreshObject. This is strictly equivalent to creating a ReadObjectQuery and cascading the refresh to private parts.

Solution B: Refreshing Query

You have to decide whether you want to refresh the object's attributes as well. Set whether to cascade the refresh to nothing, to the object's private parts, or to the object's private and public parts.

ReadObjectQuery.refreshIdentityMapResult

ReadObjectQuery.cascadePrivateParts

query.refreshIdentityMapResult();

Note that a primary key hit will never go to the database unless explicitely required to do so, which is what we're doing here.



Edit this page   More info...   Attach file...
This page last changed on 02-Jun-2005 18:09:49 PDT by 64.168.145.189.