120 likes | 252 Views
Quontra Solutions have certified trainers. Quontra Solutions are providing Exclusive Training on Java. We will cover the basics of java programming starting with all the topics. Faculty from top MNC’s with highly skilled domain expertise will train & guide you with real time examples. We are welcoming to all candidates who want to start their career as java programmer. Our trainers will teach you basic level to advanced level. Course Features: • Interview guidance – Questions • We provide Course Materials • Each topic coverage with real time solutions
E N D
Hibernate by Quontra Solutions For More info call:(404)900-9988, Mail:info@quontrasolutions.com Visit:www.quontrasolutions.com
What is Hibernate? • Hibernate is an open source, lightweight, ORM(Object Relational Mapping) tool. • It’s a pure java object relational mapping persistence framework that allows you to map plain old Java objects to relational database tables For More info call:(404)900-9988, Mail:info@quontrasolutions.com Visit:www.quontrasolutions.com
Architecture of Hibernate For More info call:(404)900-9988, Mail:info@quontrasolutions.com Visit:www.quontrasolutions.com
Example to Create a Hibernate Application in Eclipse • Create the java project • Add jar files for hibernate • Create the Persistent class • Create the mapping file for Persistent class • Create the Configuration file • Create the class that retrieves or stores the persistent object • Run the application For More info call:(404)900-9988, Mail:info@quontrasolutions.com Visit:www.quontrasolutions.com
Create the java project Open Eclipse IDE---->File Menu----->New---->Project---> Java Project----> Specify the Project name----->Finish Add Jar files To Hibernate • To add the jar files Right click on your project • Build path • Add external archives. • Now select all the jar files For More info call:(404)900-9988, Mail:info@quontrasolutions.com Visit:www.quontrasolutions.com
Create persistent Class package com.mypackage; public class Employee { private int id; private String fname,lname; public intgetId() { return id; } public void setId(int id) { this.id = id; } public String getFname() { return fname; } public void setFname(String fname) { this.fname = fname; } public String getLName() { return lName; } public void setLname(String lname) { this.lname = lname; } } Employee.java For More info call:(404)900-9988, Mail:info@quontrasolutions.com Visit:www.quontrasolutions.com
Mapping Class <?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping> <class name="com.mypackage.Employee" table="emp1000"> <id name="id"> <generator class="assigned"></generator> </id> <property name="fname"></property> <property name="lname"></property> </class> </hibernate-mapping> employee.hbm.xml For More info call:(404)900-9988, Mail:info@quontrasolutions.com Visit:www.quontrasolutions.com
<?xml version='1.0' encoding='UTF-8'?> <!DOCTYPEhibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration><session-factory><property name="hbm2ddl.auto">update</property> <property name="dialect">org.hibernate.dialect.Oracle9Dialect</property> <property name="connection.url">jdbc:oracle:thin:@localhost:1521:xe</property> <property name="connection.username">system</property><propertyname="connection.password">oracle</property> <property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property> <mapping resource="employee.hbm.xml"/> </session-factory> </hibernate-configuration> configuration Class hibernate.cfg.xml For More info call:(404)900-9988, Mail:info@quontrasolutions.com Visit:www.quontrasolutions.com
Run Application • Create a class that retrieves and stores the persistent object • To run the hibernate application, right click on the StoreData • class - Run As - Java Application. • Finally run the application For More info call:(404)900-9988, Mail:info@quontrasolutions.com Visit:www.quontrasolutions.com
Quontra Solutions Offers • informatica • JAVA • Oracle-12c DBA • Cognos • QlikView • SQL Server • MS.NET, OBIEE • data warehousing, • Sharepoint • Testing Tools • ASP.Net • Hadoop • Salesforce etc…. For More info call:(404)900-9988, Mail:info@quontrasolutions.com Visit:www.quontrasolutions.com
Thank u For More info call:(404)900-9988, Mail:info@quontrasolutions.com Visit:www.quontrasolutions.com
Any Questions For More info call:(404)900-9988, Mail:info@quontrasolutions.com Visit:www.quontrasolutions.com