public void setReferencesOn ( Bean bean ) { for ( KeyValue ref : references . values ( ) ) { final byte [ ] sidpid = ref . getQualifier ( ) ; final byte [ ] iids = ref . getValue ( ) ; final byte [ ] sid = new byte [ ] { sidpid [ 0 ] , sidpid [ 1 ] } ; final byte [ ] pid = new byte [ ] { sidpid [ 2 ] , sidpid [ 3 ] } ; final String schemaName = uids . getUsid ( ) . getName ( sid ) ; final String propertyName = uids . getUsid ( ) . getName ( pid ) ; for ( int i = 0 ; i < iids . length ; i += IID_WIDTH ) { final byte [ ] iid = new byte [ ] { iids [ i ] , iids [ i + 1 ] , iids [ i + 2 ] , iids [ i + 3 ] } ; final String instanceId = uids . getUiid ( ) . getName ( iid ) ; bean . addReference ( propertyName , BeanId . create ( instanceId , schemaName ) ) ; } } }
Set references on a bean using a set of key values containing references .