group CustomFieldSqlDao: EntitySqlDao;

tableName() ::= "custom_fields"

tableFields(prefix) ::= <<
  <prefix>object_id
, <prefix>object_type
, <prefix>field_name
, <prefix>field_value
, <prefix>created_by
, <prefix>created_date
, <prefix>updated_by
, <prefix>updated_date
>>

tableValues() ::= <<
  :objectId
, :objectType
, :fieldName
, :fieldValue
, :createdBy
, :createdDate
, :updatedBy
, :updatedDate
>>

historyTableName() ::= "custom_field_history"


getCustomFieldsForObject() ::= <<
select
<allTableFields()>
from <tableName()>
where
object_id = :objectId
and object_type = :objectType
<AND_CHECK_TENANT()>
;
>>

