group CustomFieldSqlDao;

batchInsertFromTransaction() ::= <<
    INSERT INTO custom_fields(id, object_id, object_type, field_name, field_value, created_by, created_date, updated_by, updated_date)
    VALUES (:id, :objectId, :objectType, :fieldName, :fieldValue, :userName, :createdDate, :userName, :updatedDate);
>>

batchUpdateFromTransaction() ::= <<
    UPDATE custom_fields
    SET field_value = :fieldValue, updated_by = :userName, updated_date = :updatedDate
    WHERE object_id = :objectId AND object_type = :objectType AND field_name = :fieldName;
>>

batchDeleteFromTransaction() ::= <<
    DELETE FROM custom_fields
    WHERE object_id = :objectId AND object_type = :objectType AND field_name = :fieldName;
>>

load() ::= <<
    SELECT id, object_id, object_type, field_name, field_value, created_by, created_date, updated_by, updated_date
    FROM custom_fields
    WHERE object_id = :objectId AND object_type = :objectType;
>>

test() ::= <<
    SELECT 1 FROM custom_fields;
>>
;

