|
|
(4 intermediate revisions by 2 users not shown) |
Line 1: |
Line 1: |
− | {{ScoutPage|cat=Server}}
| + | The Scout documentation has been moved to https://eclipsescout.github.io/. |
− | | + | |
− | A '''SQL lookup Service''' is a specific type of {{ScoutLink|Concepts|Lookup_Service|Lookup Service}} that works with a database.
| + | |
− | | + | |
− | * implements: {{ScoutJavadoc|ILookupService|I}}
| + | |
− | * extends: {{ScoutJavadoc|AbstractSqlLookupService|C}}
| + | |
− | | + | |
− | | + | |
− | == Description ==
| + | |
− | A '''SQL lookup Service''' provide a way to implement a {{ScoutLink|Concepts|Lookup_Service|Lookup Service}} that is very efficient to configured, if the {{ScoutLink|Concepts|LookupCall|call}} is resolved with a database.
| + | |
− | | + | |
− | Instead of implementing the 4 methods (<code>getDataByKey(LookupCall call)</code>, <code>getDataByText(LookupCall call)</code>, <code>getDataByAll(LookupCall call)</code>, <code>getDataByRec(LookupCall call)</code>), it is possible to defined the behavior of the lookup service with some configuration properties and events.
| + | |
− | | + | |
− | | + | |
− | == Properties ==
| + | |
− | ''Defined with {{ScoutLink|Concepts|GetConfigured Methods|getConfiguredXxxxxx()}} methods''.
| + | |
− | | + | |
− | {{ScoutProp|SqlSelect}}
| + | |
− | | + | |
− | {{note|TODO|SqlSelect: what should be the result}}
| + | |
− | | + | |
− | It is possible to add some special tags, that define SQL code that is kept, depending on the <code>getDataBy***(LookupCall call)</code> method called on the Lookup Service:
| + | |
− | * <code><key></code> and <code></key></code>
| + | |
− | * <code><text></code> and <code></text></code>
| + | |
− | * <code><all></code> and <code></all></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> ...) | + | |
− | | + | |
− | Here an example of a such SQL query:
| + | |
− | <source lang="sql">
| + | |
− | 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>
| + | |
− | </source>
| + | |
− | | + | |
− | | + | |
− | {{ScoutProp|SortColumn}}
| + | |
− | | + | |
− | {{note|TODO|TODO: SortColumn}}
| + | |
− | | + | |
− | == Events ==
| + | |
− | ''Defined with {{ScoutLink|Concepts|Exec_Methods|execXxxxxx()}} methods''.
| + | |
− | | + | |
− | {{ScoutEvent|LoadLookupRows}}
| + | |
− | | + | |
− | {{note|TODO|TODO: LoadLookupRows}}
| + | |
− | | + | |
− | == See Also ==
| + | |
− | * {{ScoutLink|Concepts|Lookup_Service|LookupService}}
| + | |
− | * {{ScoutLink|Concepts|LookupCall|LookupCall}}
| + | |
− | * {{ScoutLink|Concepts|LookupRow|LookupRow}}
| + | |
− | * {{ScoutLink|Concepts|Server Plug-In|Server Plug-In}}
| + | |