Searching
mNo edit summary
mNo edit summary
Line 4: Line 4:
</syntaxhighlight>Triggers search functionality using search expressions in your [[Documentation:ViewModel|ViewModel]] and populates the vSeekerResult.
</syntaxhighlight>Triggers search functionality using search expressions in your [[Documentation:ViewModel|ViewModel]] and populates the vSeekerResult.


==== See also: [[https://wiki.mdriven.net/index.php?title=Documentation:OCLOperators_Search&veaction=edit&section=1 edit] | [https://wiki.mdriven.net/index.php?title=Documentation:OCLOperators_Search&section=1&veaction=editsource edit source]] ====


* [[/wiki.mdriven.net/Documentation:Search result pages|Search result pages]]
Create a [[Documentation:ViewModel|ViewModel]] and rights click on it, select Add Nested ViewModel class and choose Add Search Expressions: [[File:Documentation Searching 1729490219452.png|left|thumb]]
Create a [[Documentation:ViewModel|ViewModel]] and rights click on it, select Add Nested ViewModel class and choose Add Search Expressions: [[File:Documentation Searching 1729490219452.png|left|thumb]]


Line 15: Line 13:
<br /><br />
<br /><br />


 
<br /><br />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.<syntaxhighlight>
 
<br />
 
<br />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. <syntaxhighlight>
Contract.allinstances->select(a|a.Name.sqllikecaseinsensitive(vSeekParam+'%') or a.Description.sqlLikeCaseInsensitive(vSeekParam +'%') or a.State.sqlLikeCaseInsensitive(vSeekParam+'%'))
Contract.allinstances->select(a|a.Name.sqllikecaseinsensitive(vSeekParam+'%') or a.Description.sqlLikeCaseInsensitive(vSeekParam +'%') or a.State.sqlLikeCaseInsensitive(vSeekParam+'%'))
</syntaxhighlight>vSeekParam is a variable, thus you can create multiple variables and several search criteria as represented by the orange section of the ViewModal class:
</syntaxhighlight>vSeekParam is a variable, thus you can create multiple variables and several search criteria as represented by the orange section of the ViewModal class:
Line 26: Line 20:




<br /><br /><br /><br /><br /><br />Search Results: vSeekerResult: This is used to display the result of the search expression in our ViewModel<br />
<br /><br /><br /><br /><br /><br />Search Results: vSeekerResult: This is used to display the result of the search expression in our ViewModel
[[File:Documentation Searching 1729492574785.png|thumb|300x300px|left]]
[[File:Documentation Searching 1729492574785.png|thumb|300x300px|left]]


<br /><br /><br /><br /><br /><br /><br />Continuation
<br /><br /><br /><br /><br /><br /><br /><br />See also: [[https://wiki.mdriven.net/index.php?title=Documentation:OCLOperators_Search&veaction=edit&section=1 edit] | [https://wiki.mdriven.net/index.php?title=Documentation:OCLOperators_Search&section=1&veaction=editsource edit source]]
* [[/wiki.mdriven.net/Documentation:Search result pages|Search result pages]]

Revision as of 06:52, 21 October 2024

We created a Seeker that translates OCL to SQL for searching in databases of any size using OCLps. We look at derivations, constraints, and validation rules. We need OCLps to seek the database without instantiating the objects in memory in the prototyper.

selfVM.Search

Triggers search functionality using search expressions in your ViewModel and populates the vSeekerResult.


Create a ViewModel and rights click on it, select Add Nested ViewModel class and choose Add Search Expressions: 

Documentation Searching 1729490219452.png







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:

Documentation Searching 1729492243556.png








Search Results: vSeekerResult: This is used to display the result of the search expression in our ViewModel

Documentation Searching 1729492574785.png









See also: [edit | edit source]

This page was edited 59 days ago on 01/20/2025. What links here