lib/core/lorj_basedefinition.rb
# Before doing a query, mapping fields
# Transform Object query field to Provider query Fields
Before doing a query, mapping fields
Transform Object query field to Provider query Fields
Before doing a query mapping fields Transform Object query field to Provider query Fields
def _query_map(object_type, hParams)
      return {} unless hParams
      object_type = object_type.to_sym if object_type.class == String
      result = {}
      maps = PrcLib.model.meta_obj.rh_get(object_type, :query_mapping)
      hParams.each do |key, value|
        key_path_obj = KeyPath.new(key)
        bold_action = ANSI.bold('ACTION REQUIRED')
        PrcLib.runtime_fail "Forj query field '%s.%s' not defined by class"\
                            " '%s'.\n#{bold_action}"\
                            ":\nMissing data model 'def_attribute' or "\
                            "'def_query_attribute' for '%s'??? "\
                            "Check the object '%s' data model.",
                            object_type, key_path_obj.key,
                            self.class, key_path_obj.key,
                            object_type unless maps.key?(key_path_obj.fpath)
        next if maps[key_path_obj.fpath].nil?
        map_path = KeyPath.new(maps[key_path_obj.fpath])
        _query_value_mapping(object_type, result, key_path_obj, map_path, value)
      end
      result
    end
def _query_map ( object_type , hParams ) return { } unless hParams object_type = object_type . to_sym if object_type . class == String result = { } maps = PrcLib . model . meta_obj . rh_get ( object_type , :query_mapping ) hParams . each do | key , value | key_path_obj = KeyPath . new ( key ) bold_action = ANSI . bold ( 'ACTION REQUIRED' ) PrcLib . runtime_fail "Forj query field '%s.%s' not defined by class" " '%s'.\n#{bold_action}" ":\nMissing data model 'def_attribute' or " "'def_query_attribute' for '%s'??? " "Check the object '%s' data model." , object_type , key_path_obj . key , self . class , key_path_obj . key , object_type unless maps . key? ( key_path_obj . fpath ) next if maps [ key_path_obj . fpath ] . nil? map_path = KeyPath . new ( maps [ key_path_obj . fpath ] ) _query_value_mapping ( object_type , result , key_path_obj , map_path , value ) end result end
Before doing a query, mapping fields
Transform Object query field to Provider query Fields
Before doing a query mapping fields Transform Object query field to Provider query Fields
object_type
<not_specific>
hParams
<not_specific>