Pertemuan 19 Building Object Database Application (Lanjutan bagian 2) Matakuliah

Download Report

Transcript Pertemuan 19 Building Object Database Application (Lanjutan bagian 2) Matakuliah

Matakuliah
Tahun
Versi
: M0174/OBJECT ORIENTED DATABASE
: 2005
: 1/0
Pertemuan 19
Building Object Database Application
(Lanjutan bagian 2)
1
Learning Outcomes
Pada akhir pertemuan ini, diharapkan mahasiswa
akan mampu :
• Mahasiswa dapat Menjelaskan ikatan
antara programming language dengan
object database (C2)
• Mahasiswa dapat Menjelaskan pembuatan
object database application (C2)
2
Outline Materi
•
•
•
•
•
Creating object and deleting object
Modification object
Manipulating relationship
Manipulating named object
OQL queries
3
Creating and Deleting Object
• C++ OML provides features for accessing
and manipulating the contents of an object
database. This is done mostly in such a
way that the C++ ODL create, deletes, and
manipulates persistent objects in the same
way that C++ does for “conventional”
transient objects.
4
Modification object
• The state of an object (transient or
persistent) is changed by either updating
its properties or executing operation on it
• Example
5
Manipulating relationship
• Relationships are implemented in C++
OML/ODL as data member defined on Ref
classes.
• The value of a relationship data member
can therefore comprise one or more
references to persistent (or transient)
object
6
Manipulating named object
• The C++ ODL/OML allows us to name
individual objects and use the object
names to retrieve the named object
• The object names provide access points
into an object database
7
OQL queries
• OQL queries can be executed from within
C++ OML/ODL programs in two ways
either by using the queries operation on
collection objects or by using the
OQL_Query interface
8
OQL queries
• Examples
D_OQL_Queries q(“select so.place_by
from salesorders so
where so.date > $1”);
q << earliest_order_date;
D_oql_execute (q, result);
9
SUMMARY
• C++ OML uses the additional built-in
classes to create, delete, and manipulate
persistent objects
• In Addition, OQL queries can be executed
via a loose binding, using query or oql
operations
10