org.killbill.billing.util.customfield.dao.CustomFieldSqlDao.sql.stg Maven / Gradle / Ivy
import "org/killbill/billing/util/entity/dao/EntitySqlDao.sql.stg"
andCheckSoftDeletionWithComma(prefix) ::= "and is_active = TRUE"
tableName() ::= "custom_fields"
tableFields(prefix) ::= <<
object_id
, object_type
, is_active
, field_name
, field_value
, created_by
, created_date
, updated_by
, updated_date
>>
tableValues() ::= <<
:objectId
, :objectType
, :isActive
, :fieldName
, :fieldValue
, :createdBy
, :createdDate
, :updatedBy
, :updatedDate
>>
historyTableName() ::= "custom_field_history"
markTagAsDeleted() ::= <<
update
set is_active = FALSE
where = :id
;
>>
updateValue() ::= <<
update
set field_value = :fieldValue
where = :id
;
>>
getCustomFieldsForObject() ::= <<
select
from
where
object_id = :objectId
and object_type = :objectType
and is_active = TRUE
;
>>
searchQuery(prefix) ::= <<
= :searchKey
or object_type like :likeSearchKey
or object_id like :likeSearchKey
or field_name like :likeSearchKey
or field_value like :likeSearchKey
>>
getSearchCountByObjectTypeAndFieldName() ::= <<
select
count(1) as count
from
where
object_type = :objectType
and field_name = :fieldName
;
>>
searchByObjectTypeAndFieldName(ordering) ::= <<
select
from
where
object_type = :objectType
and field_name = :fieldName
order by
limit :rowCount offset :offset
;
>>
getSearchCountByObjectTypeAndFieldNameValue() ::= <<
select
count(1) as count
from
where
object_type = :objectType
and field_name = :fieldName
and field_value = :fieldValue
;
>>
searchByObjectTypeAndFieldNameValue(ordering) ::= <<
select
from
where
object_type = :objectType
and field_name = :fieldName
and field_value = :fieldValue
order by
limit :rowCount offset :offset
;
>>