public static BasicDBObject getCompoundKeyColumns ( EntityMetadata m , Object id , EmbeddableType compoundKey , MetamodelImpl metaModel ) { BasicDBObject compoundKeyObj = new BasicDBObject ( ) ; Set < Attribute > attribs = compoundKey . getDeclaredAttributes ( ) ; Field [ ] fields = m . getIdAttribute ( ) . getBindableJavaType ( ) . getDeclaredFields ( ) ; // To ensure order. for ( Attribute attr : attribs ) { Field f = ( Field ) attr . getJavaMember ( ) ; if ( ! ReflectUtils . isTransientOrStatic ( f ) ) { if ( f . getAnnotation ( Embedded . class ) != null ) { EmbeddableType emb = metaModel . embeddable ( f . getType ( ) ) ; Object val = PropertyAccessorHelper . getObject ( id , f ) ; BasicDBObject dbVal = getCompoundKeyColumns ( m , val , emb , metaModel ) ; compoundKeyObj . put ( ( ( AbstractAttribute ) attr ) . getJPAColumnName ( ) , dbVal ) ; } else { compoundKeyObj . put ( ( ( AbstractAttribute ) attr ) . getJPAColumnName ( ) , populateValue ( PropertyAccessorHelper . getObject ( id , ( Field ) attr . getJavaMember ( ) ) , ( ( AbstractAttribute ) attr ) . getBindableJavaType ( ) ) ) ; } } } return compoundKeyObj ; }
Gets the compound key columns .