Difference between revisions of "Scout/Concepts/Sql Lookup Service"
Dev.jmini.fr (Talk | contribs) (→Properties) |
Dev.jmini.fr (Talk | contribs) (→Properties) |
||
Line 26: | Line 26: | ||
* <code><rec></code> and <code></rec></code> | * <code><rec></code> and <code></rec></code> | ||
− | + | The <code>call</code> is attached to the SQL query as binding. Therefore all getters on the call, are available in the query. (<code>:key</code> for <code>call.getKey()</code>, <code>:text</code> for <code>call.getText()</code>, <code>:master</code> for <code>call.getMaster()</code> ...) | |
− | + | ||
− | The <code> | + | |
+ | Here an example of a such SQL query: | ||
<source lang="sql"> | <source lang="sql"> | ||
select language_id, name, null, null, null, null, null, 1, null, 1 | select language_id, name, null, null, null, null, null, 1, null, 1 |
Revision as of 12:44, 22 March 2011
Scout |
Wiki Home |
Website |
Download • Git |
Community |
Forums • Blog • Twitter • G+ |
Bugzilla |
Bugzilla |
A SQL lookup Service is a specific type of Lookup Service that works with a database.
Contents
Description
A SQL lookup Service provide a way to implement a Lookup Service that is very efficient to configured, if the call is resolved with a database.
Instead of implementing the 4 methods (getDataByKey(LookupCall call)
, getDataByText(LookupCall call)
, getDataByAll(LookupCall call)
, getDataByRec(LookupCall call)
), it is possible to defined the behavior of the lookup service with some configuration properties and events.
Properties
Defined with getConfiguredXxxxxx() methods.
SqlSelect
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:
-
<key>
and</key>
-
<text>
and</text>
-
<all>
and</all>
-
<rec>
and</rec>
The call
is attached to the SQL query as binding. Therefore all getters on the call, are available in the query. (:key
for call.getKey()
, :text
for call.getText()
, :master
for call.getMaster()
...)
Here an example of a such SQL 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>
SortColumn
Events
Defined with execXxxxxx() methods.
LoadLookupRows