Native Queries

Native queries(NQ) were introduced by Prof. William Cook at the 27th International Conference on Software Engineering (ICSE) in May of 2005.

NQs are queries written in native language. A native query is a peace of code that receives an object of the database and returns a boolean value to indicate the query manager if the object must be included in the query result set.

Native Queries advantages are:

  • No need to learn another query language
  • As NQs are written in native language(Java or .net):
    • NQs are ‘refactorable’
    • No more problem with string based queries, NQs are checked in compile time

To implement a Native query in ODB, you must implement the interface SimpleNativeQuery. This interface do not have contract, but you must implement the following method ‘boolean match(ObjectType object)’.

page_revision: 1, last_edited: 1195562513|%e %b %Y, %H:%M %Z (%O ago)
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License