KnowledgeWorks and Prolog User Guide > 4 Objects > 4.2 Relational Database Objects

NextPrevUpTopContentsIndex

4.2.1 Example

(sql:def-view-class vehicle
          (standard-db-object standard-kb-object)
  ((vehicle_no :db-kind :key)
   (keeper)
   (owner :db-kind :join
          :db-info (:home-key :keeper
                    :foreign-key person_id
                    :retrieval :deferred
                    :join-class person))))

defines a database class vehicle where the person object in the keeper slot is retrieved from the person table in the database using the value of the keeper slot as key, only when queried. In the list of superclasses, standard-kb-object should appear after sql:standard-db-object .


KnowledgeWorks and Prolog User Guide (Windows version) - 22 Dec 2009

NextPrevUpTopContentsIndex