#NEWLINE# def get_relation_count_query( self , query , parent ) : #NEWLINE# #INDENT# '\n        Add the constraints for a relationship count query.\n\n        :type query: Builder\n        :type parent: Builder\n\n        :rtype: Builder\n        ' #NEWLINE# query . select ( QueryExpression ( 'COUNT(*)' ) ) #NEWLINE# key = self . wrap ( self . get_qualified_parent_key_name ( ) ) #NEWLINE# return query . where ( self . get_has_compare_key ( ) , '=' , QueryExpression ( key ) )