Dive into Oracle ADF

Send me a mail
 Dive into Oracle ADF   Click to see the XML version of this web page.   (Updated: 2/3/2008; 9:11:35 PM.)
Tips and tricks from Steve Muench on Oracle ADF Framework and JDeveloper IDE

Search blog with Google:
 

Search BC4J JavaDoc:
 

January 2004
Sun Mon Tue Wed Thu Fri Sat
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Dec   Feb

Get Firefox!

Monday, January 12, 2004

The findByPrimaryKey() method of oracle.jbo.server.EntityDefImpl will check to see if an entity object of the given key passed in exists in the cache, and if not, it will attempt to fault it in from the database using the value of the primary key that you've passed in.

Have you ever wanted to quickly check whether an entity object was in the cache without causing the database fault-in? Common scenarios include fast existence checking where your code might first want to check that the entity is not in the cache, but if it's not it may want to simply execute a fast existence check query instead of faulting all of that entities attributes into the entity cache.

In 9.0.3.3 and beyond, the new findInCacheByPrimaryKey() method lets you do just this.

To get hold of any entity object's definition object, just call the static getDefinitionObject() method on the desired entity object class, or if you haven't generated a Java class for your entity, you can still access its definition by using the static findDefObject() method on EntityDefImpl itself, passing in the fully-qualified name of the entity like:

EntityDefImpl def = EntityDefImpl.findDefObject("com.myco.app.MyEntity");

3:12:36 PM    



© Copyright 2008 Steve Muench.