private BasicDBObject getKeys ( EntityMetadata m , String [ ] columns ) { BasicDBObject keys = new BasicDBObject ( ) ; if ( columns != null && columns . length > 0 ) { MetamodelImpl metaModel = ( MetamodelImpl ) kunderaMetadata . getApplicationMetadata ( ) . getMetamodel ( m . getPersistenceUnit ( ) ) ; EntityType entity = metaModel . entity ( m . getEntityClazz ( ) ) ; for ( int i = 1 ; i < columns . length ; i ++ ) { if ( columns [ i ] != null ) { Attribute col = entity . getAttribute ( columns [ i ] ) ; if ( col == null ) { throw new QueryHandlerException ( "column type is null for: " + columns ) ; } keys . put ( ( ( AbstractAttribute ) col ) . getJPAColumnName ( ) , 1 ) ; } } } return keys ; }
Gets the keys .