org.killbill.billing.util.dao.NonEntitySqlDao.sql.stg Maven / Gradle / Ivy
getRecordIdFromObject(tableName) ::= <<
select
record_id
from
where id = :id
;
>>
getIdFromObject(tableName) ::= <<
select
id
from
where record_id = :recordId
;
>>
getAccountRecordIdFromAccountHistory() ::= <<
select
target_record_id
from account_history
where id = :id
;
>>
getAccountRecordIdFromAccount() ::= <<
select
record_id
from accounts
where id = :id
;
>>
getAccountRecordIdFromObjectOtherThanAccount(tableName) ::= <<
select
account_record_id
from
where id = :id
;
>>
getTenantRecordIdFromTenant() ::= <<
select
record_id
from tenants
where id = :id
;
>>
getTenantRecordIdFromObjectOtherThanTenant(tableName) ::= <<
select
tenant_record_id
from
where id = :id
;
>>
getLastHistoryRecordId(tableName) ::= <<
select
max(record_id)
from
where target_record_id = :targetRecordId
;
>>
getHistoryTargetRecordId(tableName) ::= <<
select
target_record_id
from
where record_id = :recordId
;
>>
getHistoryRecordIdIdMappings(tableName, historyTableName) ::= <<
select
ht.record_id
, t.id
from t
join ht on ht.target_record_id = t.record_id
where t.account_record_id = :accountRecordId
and t.tenant_record_id = :tenantRecordId
;
>>
getHistoryRecordIdIdMappingsForAccountsTable(tableName, historyTableName) ::= <<
select
ht.record_id
, t.id
from t
join ht on ht.target_record_id = t.record_id
where t.record_id = :accountRecordId
and t.tenant_record_id = :tenantRecordId
;
>>
getHistoryRecordIdIdMappingsForTablesWithoutAccountRecordId(tableName, historyTableName) ::= <<
select
ht.record_id
, t.id
from t
join ht on ht.target_record_id = t.record_id
where 1 = 1
and t.tenant_record_id = :tenantRecordId
;
>>
getRecordIdIdMappings(tableName) ::= <<
select
t.record_id
, t.id
from t
where t.account_record_id = :accountRecordId
and t.tenant_record_id = :tenantRecordId
;
>>