1 / 13

Object and object-relational databases

Object and object-relational databases. Object databases vs. Object-relational databases. Object databases. Object-relational databases. Relational DBMS with some object features Latest SQL standard (2008) includes some OO features Some database management systems Oracle.

jereni
Download Presentation

Object and object-relational databases

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Object and object-relational databases Object and object-relational databases

  2. Object databases vs. Object-relational databases Object databases Object-relational databases Relational DBMS with some object features Latest SQL standard (2008) includes some OO features Some database management systems Oracle • Stores complex objects • Data + functions • Uses classes and objects • As in object-oriented programming: Java, C#, etc. • Some database management systems • Gemstone • Objectivity • Versant • ObjectStore Object and object-relational databases

  3. Object identity • Every object in a object database must have a unique identity. • Called object identity (OID) • ID’s in relational databases must be unique within the table only. • OID generated by DBMS • OID must be immutable • Literals (simple values) have no OID Object and object-relational databases

  4. Complex type structures • Atoms • Single value types, like string, int, etc. • Struct aka. Tuple • Type generator: Heterogeneous members (different types) • Examples • Struct Name<firstname: string, lastname: string> • Struct Student<name: Name, address: string> • Collection aka. Multi-valued • Type generator: Homogeneous members (same type) • Set(T), List(T), bag(T), array(T), dictionary(T) • Sub-types • You can define a sub-type of a struct by extending the struct. Object and object-relational databases

  5. Collections • Set(T) • Distinct members, duplicates not allowed • Java: Set<T> • Bag(T) • Duplicates members allowed • Java: Collection<T> • List(T) • Duplicates members allowed. Unlimited capacity • Ordered list • It makes sense to ask for 1st element, 2nd element, etc. • Order, is not necessarily sorting order • Java: List<T> • Array(T) • Like List(T), but Array(T) has a maximum size Object and object-relational databases

  6. Example: Defining complex types Object and object-relational databases

  7. Example: Defining complex types with operations Object and object-relational databases

  8. Object-Relational databases • Object-relational database • Add some object oriented features to an otherwise relational database • Type constructors • Object identity • Operations • Inheritance / sub-types • Tables creates using simple types + ”homemade” types • Example Object-relational DBMS • Oracle has many OO features • Microsoft SQL Server has no OO features Object and object-relational databases

  9. ODMG Object model and ODL • ODMG =Object Data Management Group • Standard committee for Object oriented databases • ODMG 1.0, 2.0, 3.0 • Object model • ODL = Object Definition Language • ODL terms • Extent: Contains the persistent objects of a class • Key: One or more properties (attributes or relationships) • Factory object: similar to constructor in object-oriented programming Object and object-relational databases

  10. ODMG database schema Object and object-relational databases

  11. ODMG ODL example Object and object-relational databases

  12. Object Query Language (OQL) • Defined by ODMG • Writing queries for the ODMG object model • Basic structure • Select … from … where • As in ordinary SQL • Example Select D.name from D in Departments where D.college = ’Engineering’ • Departments is an ’extent’ • D is a so-called iterator variable Object and object-relational databases

  13. Object-relational mapping (ORM) • Alternative to object databases and object-relational databases • ORM programming technique to convert data between object-oriented programming languages and relational databases. • A virtual object database • Some frameworks • Hibernate for Java • NHibernate for Microsoft .NET • ADO.NET Entity Framework for Microsoft.NET Object and object-relational databases

More Related