12
1 Pertemuan 16 Object Query Language (Lanjutan bagian 3) Matakuliah : M0174/OBJECT ORIENTED DATABASE Tahun : 2005 Versi : 1/0

Pertemuan 16 Object Query Language (Lanjutan bagian 3)

  • Upload
    zazu

  • View
    57

  • Download
    2

Embed Size (px)

DESCRIPTION

Pertemuan 16 Object Query Language (Lanjutan bagian 3). Matakuliah: M0 1 74 /OBJECT ORIENTED DATABASE Tahun: 2005 Versi: 1 / 0. Learning Outcomes. Pada akhir pertemuan ini, diharapkan mahasiswa akan mampu : Mahasiswa dapat Menghasilkan query language dalam object data model (C3). - PowerPoint PPT Presentation

Citation preview

Page 1: Pertemuan 16 Object Query Language (Lanjutan bagian 3)

1

Pertemuan 16Object Query Language (Lanjutan bagian

3)

Matakuliah : M0174/OBJECT ORIENTED DATABASETahun : 2005Versi : 1/0

Page 2: Pertemuan 16 Object Query Language (Lanjutan bagian 3)

2

Learning Outcomes

Pada akhir pertemuan ini, diharapkan mahasiswa akan mampu :• Mahasiswa dapat Menghasilkan query

language dalam object data model (C3)

Page 3: Pertemuan 16 Object Query Language (Lanjutan bagian 3)

3

Outline Materi

• Retrieving • Creating structured • Creating mutable • Creating collections • Conversion

Page 4: Pertemuan 16 Object Query Language (Lanjutan bagian 3)

4

Retrieving

• Definition• Example

– Return the existing Product object with the object name, best_seller

best_seller– Return a string literal, which is the value of the

name attribute of the product object called best_seller

best_seller.name

Page 5: Pertemuan 16 Object Query Language (Lanjutan bagian 3)

5

Retrieving

– Return a collection-object which contains the existing mutable product object for the bat bike product

select p from products p where p.name = “bat bike”;

Page 6: Pertemuan 16 Object Query Language (Lanjutan bagian 3)

6

Retrieving

– Return a literal collection-object containing string literals which are the values of the colour attribute of mutable product object

select p.colour from products p

Page 7: Pertemuan 16 Object Query Language (Lanjutan bagian 3)

7

Creating structured

• Structured-literal (set, bag, list, array, and structure-literal) can be created using the object constructor operators, struct, set, bag, list, and array

• Example

Page 8: Pertemuan 16 Object Query Language (Lanjutan bagian 3)

8

Creating structured

<query> ::= struct ([<identifier> : <query> [,<identifier> : <query>] *] ) | set ([<query> [,<query> *] )|

bag ([<query> [,<query> *] )| list ([<query> [,<query> *] )| array ([<query> [,<query> *] )

Page 9: Pertemuan 16 Object Query Language (Lanjutan bagian 3)

9

Creating mutable

• Type names are used as constructor operators to create new mutable objects of the specified type

• Example

Page 10: Pertemuan 16 Object Query Language (Lanjutan bagian 3)

10

Creating collections

• The select…from…where form of OQL has number of variations which can be used to return different types of collection object– The general form– The distinct– The group by– An order by

• Example

Page 11: Pertemuan 16 Object Query Language (Lanjutan bagian 3)

11

Conversion

• Listtoset• Distinct• Element• Flatten• Example

Page 12: Pertemuan 16 Object Query Language (Lanjutan bagian 3)

12

SUMMARY

• OQL can retrieve existing objects and can also create new ones

• New objects can be created using the constructors, set, bag, list, array, and struct

• OQL also includes operators for changing the type of an object (listtoset, distinct,element, and flatten)