Fundamentals of MyBATIS

Slides:



Advertisements
Similar presentations
Connecting to Databases. relational databases tables and relations accessed using SQL database -specific functionality –transaction processing commit.
Advertisements

Spring, Hibernate and Web Services 13 th September 2014.
.NET Database Technologies: Open-Source Frameworks.
Introduction to the Spring Framework University of Kansas January 2009 This presentation and example application are available at
Integrating SOA and the Application Development Framework Shaun O’Brien Principal Product Manager – Oracle JDeveloper / ADF.
ORACLE Lecture 1: Oracle 11g Introduction & Installation.
Fast Track to ColdFusion 9. Getting Started with ColdFusion Understanding Dynamic Web Pages ColdFusion Benchmark Introducing the ColdFusion Language Introducing.
Session-02.
Session-01. Hibernate Framework ? Why we use Hibernate ?
Overview of Database Access in.Net Josh Bowen CIS 764-FS2008.
Intro to Spring CJUG - January What is Spring? “The Spring framework provides central transaction control of various objects.” This means that any.
Using Third-Party Frameworks in Building Blocks™ David Ashman Principal Architect, Product Development.
An Introduction to Hibernate Matt Secoske
Data Persistence and Object-Relational Mapping Slides by James Brucker, used with his permission 1.
UNIT-V The MVC architecture and Struts Framework.
Object Persistence and Object-Relational Mapping James Brucker.
Hibernatification! Roadmap for Migrating from Plain Old SQL on JDBC to JPA on Hibernate Duke Banerjee Senior Developer, DrillingInfo.com.
Training - Day 3 OJB. What is OR Mapping? OR Mapping is the mapping of relational database tables to objects (Java Objects in our case) Many OR Mapping.
Advance Computer Programming Java Database Connectivity (JDBC) – In order to connect a Java application to a database, you need to use a JDBC driver. –
NetArchive Suite Workshop 2011 Technical Track - Code refactoring with the Spring Framework.
1 Java Database Connection (JDBC) There are many industrial-strength DBMS's commercially available in the market. Oracle, DB2, and Sybase are just a few.
UPortal Developers MIT August 2004 Persistence Strategy for uPortal 3 Mike DeSimone the r-smart group
Agenda What is Hibernate Spring Integration Questions Overview
Portlet Framework: the Liferay way Liferay Service Builder, Portlet MVC Catania, 10/06/2014Riccardo Rotondo.
CHAPTER 14 USING RELATIONAL DATABASES TO PROVIDE OBJECT PERSISTENCE (ONLINE) © 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 Modern Database.
M1G Introduction to Database Development 6. Building Applications.
Seminar on. Overview Hibernate. What is it? Hibernate. How does it work? Hibernate Tools.
Creating and using Persistent Data From before – Where does the data come from? – Why is it kept? – How is it used? Affects design and implementation choices.
JDBC Java and Databases. RHS – SOC 2 JDBC JDBC – Java DataBase Connectivity An API (i.e. a set of classes and methods), for working with databases in.
© 2011 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 14 Using Relational Databases to Provide Object Persistence (Overview) Modern Database.
Spring Database Access Ojitha Kumanayaka Copyright © Virtusa, 2007.
Topic : Hibernate 2: Object Persistence and ORM Kaster Nurmukan.
Domain and Persistence Patterns. Fundamental Pattern Types Design Patterns Business Logic Patterns.
JPA / HIBERNATE CSCI 6370 Nilayan Bhattacharya Sanket Sable.
UNIT III - JDBC JDBC Overview – JDBC implementation – Connection class – Statements - Catching Database Results, handling database Queries. Networking–
DATABASE CONNECTIVITY TO MYSQL. Introduction =>A real life application needs to manipulate data stored in a Database. =>A database is a collection of.
Text 16 de mayo de 2009 Spring Framework Part III. Portable Service Abstractions Buenos Aires, June 2009.
Persistence – Iteration 4 Vancouver Bootcamp Aaron Zeckoski
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Introduction to Data Access with Spring.
Text 16 de mayo de 2009 Spring Framework Part III. Portable Service Abstractions Buenos Aires, June 2009.
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Overview of the Spring Framework Introducing.
Overview of C/C++ DB APIs Dirk Düllmann, IT-ADC Database Workshop for LHC developers 27 January, 2005.
Introduction – ORM, Helloworld Application
Copyright 2007, Information Builders. Slide 1 iWay Web Services and WebFOCUS Consumption Michael Florkowski Information Builders.
JDBC Java and Databases. SWC – JDBC JDBC – Java DataBase Connectivity An API (i.e. a set of classes and methods), for working with databases in.
Singleton Academy, Pune. Course syllabus Singleton Academy Pune – Course Syllabus1.
.  A reference model developed for an important use case (Air Job) including UI widgets, controllers, services and DAOs.  After full requirement analysis.
Introduction to ORM Hibernate Hibernate vs JDBC. May 12, 2011 INTRODUCTION TO ORM ORM is a programming technique for converting data between relational.
Text 16 de mayo de 2009 Spring Framework Part III. Portable Service Abstractions and Spring MVC Buenos Aires, June 2009.
Google Code Libraries Dima Ionut Daniel. Contents What is Google Code? LDAPBeans Object-ldap-mapping Ldap-ODM Bug4j jOOR Rapa jongo Conclusion Bibliography.
Hibernate Online Training. Introduction to Hibernate Hibernate is a high-performance Object-Relational persistence and query service which takes care.
Hibernate Java Persistence API. What is Persistence Persistence: The continued or prolonged existence of something. Most Applications Achieve Persistence.
2011 년 11 월 23 일 제 13 장.  ORM 프레임워크인 iBATIS  MySQL 설치하기  iBATIS 를 사용한 JDBC  SQL Map API.
Tutorial on Science Gateways, Roma, Riccardo Rotondo Portlet Framework: the Liferay way Liferay Service Builder, Portlet MVC.
Fundamentals of MyBATIS Improving performance with caching.
HIBERNATE/Java Overview of technology for Hibernate by محمد حسن کاظمی پوران Master : M.M.Nematollahi.
Best 3 Software Development Languages. Hibernate Training Hibernate is a high-performance object-relational mapping tool and query service. Hibernate.
New Technology: Why, What ,How
DEPTT. OF COMP. SC & APPLICATIONS
Introduction to Persistency
ODBC, OCCI and JDBC overview
A very brief introduction
POOL persistency framework for LHC
Entity Framework By: Casey Griffin.
Intro to Spring CJUG - January 2013.
Testing a persistence layer
Java Database Connectivity
Developing PiMS 1.0 Bill Lin.
Developing and testing enterprise Java applications
Data Access Layer (Con’t) (Overview)
Presentation transcript:

Fundamentals of MyBATIS What is MyBATIS?

Introduction Why use MyBATIS? When not to use MyBATIS Mapping SQL How it works

Overview MyBatis is an open source persistence framework that simplifies the implementation of the persistence layer by abstracting a lot of JDBC boilerplate code and provides a simple and easy-to-use API to interact with the database. MyBatis was formerly known as iBATIS and was started by Clinton Begin in 2002. MyBatis 3 is a complete redesign of iBATIS, with annotations and Mapper support.

Overview The main reason for the popularity of MyBatis is its simplicity and ease of use. In Java applications, the persistence layer involves populating Java objects with data loaded from the database using SQL queries, and persisting the data in Java objects into the database using SQL. MyBatis makes using SQL easy by abstracting low-level JDBC code, automating the process of populating the SQL result set into Java objects, and persisting data into tables by extracting the data from Java objects.

Why use MyBATIS? There are many Java-based persistence frameworks, however MyBatis became popular because of the following reasons: It Eliminates a lot of JDBC boilerplate code It has a low learning curve It works well with legacy databases It embraces SQL It provides support for integration with Spring and Guice frameworks It provides support for integration with third-party cache libraries It induces better performance

When not to use MyBATIS If you design your application starting from an object model, the database platform is a moving target, you have a complex object model with lots of different queries to perform, Hibernate is your choice. On the contrary, if you think relational and the application is a by-product of the database design, then MyBatis should be better.

Mapping SQL The true power of MyBatis is in the Mapped Statements. This is where the magic happens. For all of their power, the Mapper XML files are relatively simple. Certainly if you were to compare them to the equivalent JDBC code, you would immediately see a savings of 95% of the code. MyBatis was built to focus on the SQL, and does its best to stay out of your way.

How It Works In MyBatis 3, we have two types for configuration files: Environment Specification Configuration File: There will be only one file that will define the environmental settings that are to be used by MyBatis mapping framework. This file defines the settings related to database connection, driver, transaction management, connection pooling, other mapping files and a lot more that we will see in upcoming tutorials. Mapping Files: There can be more than one mapping file in one application for MyBatis framework. A mapping file carries information about set of related service that is defined in an Java interface. It defines parametrized SQL Statement to be used for a particular service, inputs to to the SQL parameters and also defines return mapping for the resultant data if returned back by SQL statement.