Scout/Concepts/Sql Lookup Service
|Download • Git|
|Forums • Blog • Twitter • G+|
A SQL lookup Service is a specific type of Lookup Service that works with a database.
Instead of implementing the 4 methods (
getDataByRec(LookupCall call)), it is possible to defined the behavior of the lookup service with some configuration properties and events.
Defined with getConfiguredXxxxxx() methods.
It is possible to add some special tags, that define SQL code that is kept, depending on the
getDataBy***(LookupCall call) method called on the Lookup Service:
Depending on the function that is called (by key, by text, by all, by rec) only the portion of the SQL query beetween the corresponding tag is keept.
getDataByKey(LookupCall call) is attached to the query as binding. Therefore all getters on the call, are available in the query.
SELECT language_id, name, NULL, NULL, NULL, NULL, NULL, 1, NULL, 1 FROM LANGUAGE <key>WHERE language_id = :key</key> <text>WHERE UPPER(name) LIKE UPPER('%'||:text||'%')</text>
Defined with execXxxxxx() methods.