All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.ning.billing.queue.dao.QueueSqlDao.sql.stg Maven / Gradle / Ivy

group BaseSqlDao;

/** TO BE OVERWRITTEN IN CHILD TEMPLATE **/


readyWhereClause() ::= <<
>>


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
>>

searchFieldsWithComma() ::= <<
      , search_key1
      , search_key2
>>


allTableFieldsNoRecordId() ::= <<
      
      
      
      
>>

allTableFields() ::= <<
      
      
      
      
>>

/** VALUES **/

baseValuesNoRecordId() ::= <<
      :className
      , :eventJson
      , :userToken
      , :createdDate
>>

baseValues() ::= <<
     :recordId
     , 
>>

lifeCycleValuesWithComma() ::= <<
      , :creatingOwner
      , :processingOwner
      , :processingAvailableDate
      , :processingState
>>

searchValuesWithComma() ::= <<
      , :searchKey1
      , :searchKey2
>>

allTableValuesNoRecordId() ::= <<
      
      
      
      
>>

allTableValues() ::= <<
      
      
      
      
>>


getLastInsertId() ::= <<
    select LAST_INSERT_ID();
>>

getByRecordId(tableName) ::= <<
    select
      
    from 
    where
    record_id = :recordId
    ;
>>


/** QUERIES **/

getEntriesFromIds(tableName, record_ids) ::= <<
    select
      
    from 
    where
      record_id in (}; separator="," >)
    order by
      
    ;
>>

getReadyEntries(tableName) ::= <<
    select
      
    from 
    where
      
    order by
      
    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 OR processing_available_date \<= :now)
    ;
>>

removeEntry(tableName) ::= <<
    delete from 
    where
      record_id = :recordId
    ;
>>


insertEntry(tableName) ::= <<
    insert into  (
       
    ) values (
       
    );
>>


/**

removeNotificationsByKey() ::= <<
    update notifications
    set
      processing_state = 'REMOVED'
    where
      event_json = :eventJson
    ;
>>


getPendingCountNotifications() ::= <<
    select
      count(*)
    from notifications
    where
      effective_date \<= :now
      and processing_state = 'AVAILABLE'
    ;
>>


**/






© 2015 - 2025 Weber Informatics LLC | Privacy Policy