org.killbill.queue.dao.QueueSqlDao.sql.stg Maven / Gradle / Ivy
/** TO BE OVERWRITTEN IN CHILD TEMPLATE **/
readyWhereClause(owner) ::= <<
>>
readyOrderByClause() ::= <<
>>
extraFieldsWithComma() ::= <<
>>
extraValuesWithComma() ::= <<
>>
/** FIELDS **/
baseFieldsNoRecordId() ::= <<
class_name
, event_json
, user_token
, created_date
>>
baseFields() ::= <<
record_id
,
>>
lifeCycleFieldsWithComma() ::= <<
, creating_owner
, processing_owner
, processing_available_date
, processing_state
, error_count
>>
searchFieldsWithComma() ::= <<
, search_key1
, search_key2
>>
allTableFieldsNoRecordId() ::= <<
>>
allTableFields() ::= <<
>>
/** VALUES **/
baseValuesNoRecordId() ::= <<
:className
, :eventJson
, :userToken
, :createdDate
>>
baseValues() ::= <<
:recordId
,
>>
lifeCycleValuesWithComma() ::= <<
, :creatingOwner
, :processingOwner
, :processingAvailableDate
, :processingState
, :errorCount
>>
searchValuesWithComma() ::= <<
, :searchKey1
, :searchKey2
>>
allTableValuesNoRecordId() ::= <<
>>
allTableValues() ::= <<
>>
getMaxRecordId(tableName) ::= <<
select max(record_id)
from
;
>>
getByRecordId(tableName) ::= <<
select
from
where
record_id = :recordId
;
>>
/** QUERIES **/
getEntriesFromIds(tableName, record_ids) ::= <<
select
from
where
record_id in ()
order by
;
>>
getReadyEntries(owner, tableName) ::= <<
select
from
where
order by
limit :max
;
>>
getNbReadyEntries(owner, tableName) ::= <<
select
count(*)
from
where
;
>>
getInProcessingEntries(tableName) ::= <<
select
from
where
processing_state = 'IN_PROCESSING'
order by
;
>>
getEntriesLeftBehind(tableName) ::= <<
select
from
where
order by created_date asc
limit :max;
>>
claimEntry(tableName) ::= <<
update
set
processing_owner = :owner
, processing_available_date = :nextAvailable
, processing_state = 'IN_PROCESSING'
where
record_id = :recordId
and processing_state != 'PROCESSED'
and processing_state != 'REMOVED'
and processing_owner IS NULL
;
>>
claimEntries(tableName, record_ids) ::= <<
update
set
processing_owner = :owner
, processing_available_date = :nextAvailable
, processing_state = 'IN_PROCESSING'
where
record_id in ()
and processing_state != 'PROCESSED'
and processing_state != 'REMOVED'
and processing_owner IS NULL
;
>>
updateOnError(tableName) ::= <<
update
set
processing_owner = NULL
, processing_available_date = :now
, processing_state = 'AVAILABLE'
, error_count = :errorCount
where
record_id = :recordId
;
>>
removeEntry(tableName) ::= <<
delete from
where
record_id = :recordId
;
>>
removeEntries(tableName, record_ids) ::= <<
delete from
where
record_id in ()
;
>>
insertEntry(tableName) ::= <<
insert into (
) values (
);
>>
insertEntries(tableName) ::= <<
insert into (
) values (
)
>>
© 2015 - 2025 Weber Informatics LLC | Privacy Policy