We created a Seeker that translates OCL to SQL for searching in databases of any size using <a href="/Documentation:OCLps" title="Documentation:OCLps" data-bs-title="Documentation:OCLps">OCLps</a>. We look at derivations, constraints, and validation rules. We need <a href="/Documentation:OCLps" title="Documentation:OCLps" data-bs-title="Documentation:OCLps">OCLps</a> to seek the database without instantiating the objects in memory in the prototyper.
selfVM.Search
Triggers search functionality using search expressions in your <a href="/Documentation:ViewModel" title="Documentation:ViewModel" data-bs-title="Documentation:ViewModel">ViewModel</a> and populates the vSeekerResult.
Create a ViewModel and right click on it, select Add Nested ViewModel class and choose Add Search Expressions:
Search Expression: The criteria OCLps a subset of SQL, its main purpose is to be easily transformed to SQL and executed as SQL in the database.
Contract.allinstances->select(a|a.Name.sqllikecaseinsensitive(vSeekParam+'%') or a.Description.sqlLikeCaseInsensitive(vSeekParam +'%') or a.State.sqlLikeCaseInsensitive(vSeekParam+'%'))
vSeekParam is a variable, thus you can create multiple variables and several search criteria as represented by the orange section of the ViewModal class:
<a href="/Documentation:Search_result_pages" title="Documentation:Search result pages" data-bs-title="Documentation:Search_result_pages">Search result pages</a>