public Object [ ] getForeignKeyValues ( Object obj , ClassDescriptor mif ) throws PersistenceBrokerException { FieldDescriptor [ ] fks = getForeignKeyFieldDescriptors ( mif ) ; // materialize object only if FK fields are declared if ( fks . length > 0 ) obj = ProxyHelper . getRealObject ( obj ) ; Object [ ] result = new Object [ fks . length ] ; for ( int i = 0 ; i < result . length ; i ++ ) { FieldDescriptor fmd = fks [ i ] ; PersistentField f = fmd . getPersistentField ( ) ; // BRJ: do NOT convert. // conversion is done when binding the sql-statement // // FieldConversion fc = fmd.getFieldConversion(); // Object val = fc.javaToSql(f.get(obj)); result [ i ] = f . get ( obj ) ; } return result ; }
Returns an Object array of all FK field values of the specified object . If the specified object is an unmaterialized Proxy it will be materialized to read the FK values .