 
                        
        
                        
        org.killbill.notificationq.dao.NotificationSqlDao.sql.stg Maven / Gradle / Ivy
import "org/killbill/queue/dao/QueueSqlDao.sql.stg"
extraFieldsWithComma() ::= <<
      , future_user_token
      , effective_date
      , queue_name
>>
extraValuesWithComma() ::= <<
      , :futureUserToken
      , :effectiveDate
      , :queueName
>>
readyWhereClause(owner) ::= <<
    effective_date \<= :now
    and processing_state = 'AVAILABLE'
and creating_owner = ''
>>
reapWhereClause() ::= <<
    processing_state != 'PROCESSED'
    and processing_state != 'REMOVED'
    and (processing_owner IS NULL OR processing_available_date \<= :now)
    and effective_date \<= :reapingDate
>>
readyOrderByClause() ::= <<
        effective_date asc
      , created_date asc
      , record_id
>>
/** Notifications specific queries **/
getReadyQueueEntriesForSearchKeys(tableName) ::= <<
    select
      
    from 
    where
      queue_name = :queueName
      and processing_state = 'AVAILABLE'
      and search_key1 = :searchKey1
      and search_key2 = :searchKey2
    order by
      
;
>>
getReadyQueueEntriesForSearchKey2(tableName) ::= <<
    select
      
    from 
    where
      queue_name = :queueName
      and processing_state = 'AVAILABLE'
      and effective_date \< cast(coalesce(:maxEffectiveDate, '2100-01-01') as datetime)
      and search_key2 = :searchKey2
    order by
      
;
>>
getReadyOrInProcessingQueueEntriesForSearchKeys(tableName) ::= <<
    select
      
    from 
    where
      queue_name = :queueName
      and processing_state in ('AVAILABLE', 'IN_PROCESSING')
      and search_key1 = :searchKey1
      and search_key2 = :searchKey2
    order by
      
;
>>
getReadyOrInProcessingQueueEntriesForSearchKey2(tableName) ::= <<
    select
      
    from 
    where
      queue_name = :queueName
      and processing_state in ('AVAILABLE', 'IN_PROCESSING')
      and effective_date \< cast(coalesce(:maxEffectiveDate, '2100-01-01') as datetime)
      and search_key2 = :searchKey2
    order by
      
;
>>
getHistoricalQueueEntriesForSearchKeys(historyTableName) ::= <<
    select
      
    from 
    where
      queue_name = :queueName
      and search_key1 = :searchKey1
      and search_key2 = :searchKey2
    order by
      
;
>>
getHistoricalQueueEntriesForSearchKey2(historyTableName) ::= <<
    select
      
    from 
    where
          queue_name = :queueName
      and effective_date >= cast(coalesce(:minEffectiveDate, '1970-01-01') as datetime)
      and search_key2 = :searchKey2
    order by
      
;
>>
updateEntry(tableName) ::= <<
    update 
    set event_json = :eventJson
    where
    record_id = :recordId
    and search_key1 = :searchKey1
    and search_key2 = :searchKey2
;
>>
                      © 2015 - 2025 Weber Informatics LLC | Privacy Policy