DOC PREVIEW
MIT 6 830 - Lecture Notes

This preview shows page 1 out of 3 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 3 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 3 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

ORM: Problem: Impedance Mismatch (i.e., different languages for data and programming, need casting between types, makes analysis difficult) Solution: Object-Relation-Mapping middleware (provide an persistence abstraction for objects, and takes care of transformation from/to the DB world)"Everyone who is somebody has one! Either standard (e.g., hibernate) or ad-hoc." The idea is to provide:- pre-canned mapping between OO classes/fields and table/columns- manually defined mappings- provides object persistency without looking at the DB Good: - abstraction - ease of debug Bad: - performance Example: Hibernate Example of Hibernate Mapping <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" Application dialogs- Swing- SWT- Web applicationApplication logicClass Order Class CustomerInstance of Customer classHibernateRow of Customer tableDatabaseTable Order-id-number-customer_idTable Customer-id-firstname-lastname-dateImage by MIT OpenCourseWare.------------------------------------------------------------------------------------------"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" ><hibernate-mapping><class name="de.laliluna.example.Honey" table="honey"> <id name="id" column="id" > <generator class="increment"/> </id> <property name="name" column="fooname" /> <property name="taste" column="bartaste" /> </class> </hibernate-mapping> Example of Hibernate Usage (many details are hidden) Honey honey = new Honey(); honey.setName("forest honey"); honey.setTaste("very sweet"); … tx = session.beginTransaction(); session.save(honey); tx.commit(); … tx = session.beginTransaction(); session.update(honey); tx.commit(); … tx = session.beginTransaction(); List honeys = session.createQuery("select h from Honey as h").list(); tx.commit(); Next we talk about DriadLINQ… it provides similar features but adds much more in particular:- LINQ language integration- Batch-oriented - Cluster-oriented - More than SQLMIT OpenCourseWare http://ocw.mit.edu 6.830 / 6.814 Database Systems Fall 2010 For information about citing these materials or our Terms of Use, visit:


View Full Document
Download Lecture Notes
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture Notes and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture Notes 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?