public Query getPKQuery ( Identity oid ) { Object [ ] values = oid . getPrimaryKeyValues ( ) ; ClassDescriptor cld = pb . getClassDescriptor ( oid . getObjectsTopLevelClass ( ) ) ; FieldDescriptor [ ] fields = cld . getPkFields ( ) ; Criteria criteria = new Criteria ( ) ; for ( int i = 0 ; i < fields . length ; i ++ ) { FieldDescriptor fld = fields [ i ] ; criteria . addEqualTo ( fld . getAttributeName ( ) , values [ i ] ) ; } return QueryFactory . newQuery ( cld . getClassOfObject ( ) , criteria ) ; }
Answer the primary key query to retrieve an Object