public final class SQLBundle extends Object
-- Statements for MJB bulk operations
--!update_elements
insert into bae_element_instanties(bot_id, bet_id, bei_aanbrengdatum, bei_einde_levensduur, bei_waarde_dec, bei_omschrijving)
select t.bot_id, t.bet_id, t.bew_datum_ingang, add_months(t.bew_datum_ingang, 12 * nvl(nec_levensduur_cyclus,50)), nvl(t.bew_waarde_dec,t.bew_waarde_num), t2.bet_element
from bae_element_waarden t, bae_elementen t2, npo_elementcodes t3
where t.bet_id = t2.bet_id
and t2.nec_id = t3.nec_id
and t2.bet_mjb = 'Y'
and not exists (select 1 from bae_element_instanties ii where ii.bew_id = t.bew_id)
/
--!select_item
select * from crm_subjects where cst_id=$0
Each statement must be preceded by --![key], the key name there is used to retrieve the statement from the
bundle. The statement itself is then a string that is either terminated by the next --![name] or by a / at
the 1st position on the line.
Statements can be parameterized using $[integer]. The integer index is 0-based and the same number can be repeated throughout the statement. Parameters for the actual query are passed as Object[], and the $integer represents the index into that array. It means that you can easily reuse the same value multiple times in the same statement.
SQLBundle's are cached in the system and a single bundle only occurs once in memory. They are weakly linked so they can be garbage-collected when needed.
| Modifier and Type | Method and Description |
|---|---|
static SQLBundle |
create(Class<?> base)
Create a SQL Statement bundle with the default name "sqlbundle.sql" in the package where
the specified class is residing.
|
static SQLBundle |
create(Class<?> base,
String name)
Create a SQL statement resource bundle from the specified class resource (name and class).
|
BundleStatement |
getStatement(String key) |
String |
getString(String name)
Get the specified statement string.
|
@Nonnull public static SQLBundle create(@Nonnull Class<?> base)
base - @Nonnull public static SQLBundle create(@Nonnull Class<?> base, @Nonnull String name)
base - name - @Nonnull public String getString(@Nonnull String name)
name - @Nonnull public BundleStatement getStatement(@Nonnull String key)
Copyright © 2017 etc.to. All rights reserved.