static BasicDBObject [ ] getDocumentListFromCollection ( Metamodel metaModel , Collection coll , Set < Attribute > columns , String tableName ) throws PropertyAccessException { BasicDBObject [ ] dBObjects = new BasicDBObject [ coll . size ( ) ] ; int count = 0 ; for ( Object o : coll ) { dBObjects [ count ] = ( BasicDBObject ) getDocumentFromObject ( metaModel , o , columns , tableName ) . values ( ) . toArray ( ) [ 0 ] ; count ++ ; } return dBObjects ; }
Creates a MongoDB document list from a given java collection . columns in the document correspond Columns provided as List .