<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-17356771</id><updated>2011-12-14T19:02:37.247-08:00</updated><title type='text'>Quick Hibernate</title><subtitle type='html'>Quick Hibernate gets you started with Hibernate in no time.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://quickhibernate.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17356771/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://quickhibernate.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Swati Talim</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>1</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-17356771.post-112822879647245204</id><published>2005-10-01T21:33:00.000-07:00</published><updated>2006-06-24T18:37:24.136-07:00</updated><title type='text'>Quick Hibernate - Part 1</title><content type='html'>&lt;div style="font-family: verdana, arial, sans-serif; line-height:12px; font-size: 11px; text-align: justify;"&gt;&lt;b&gt;&lt;a href="http://www.hibernate.org/" target="_blank" &gt;Hibernate&lt;/a&gt;&lt;/b&gt; is a powerful, ultra-high performance object/relational persistence and query service for &lt;b&gt;Java&lt;/b&gt;. &lt;b&gt;Hibernate&lt;/b&gt; gives you the option to code and work with &lt;b&gt;Java&lt;/b&gt; and use &lt;b&gt;Hibernate's&lt;/b&gt; capabilities to interact with the database. No need to write SQL in your &lt;b&gt;Java&lt;/b&gt; code. You work with &lt;b&gt;Java&lt;/b&gt; objects and &lt;b&gt;Hibernate&lt;/b&gt; does the rest.&lt;br /&gt;&lt;br /&gt;In this &lt;b&gt;"Quick Hibernate"&lt;/b&gt; article, Satish Talim gets you started with &lt;b&gt;Hibernate&lt;/b&gt;. Satish's hands-on approach should have you developing with &lt;b&gt;Hibernate&lt;/b&gt; in no time.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;About the author:&lt;/b&gt;&lt;br /&gt;Satish Talim was interviewed by &lt;b&gt;&lt;a href="http://indicthreads.com/interviews/java_j2ee_today.html" target="_blank" &gt;Java and J2EE Today&lt;/a&gt;&lt;/b&gt;. This article appeared in &lt;b&gt;&lt;a href="http://weblogs.java.net/blog/editors/archives/2005/06/_making_a_diffe.html" target="_blank" &gt;java.net&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;He has several blogs to his credit.&lt;br /&gt;&lt;b&gt;&lt;a href="http://punejava.blogspot.com/" target="_blank" &gt;PuneJava&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://satishtalim.blogspot.com/" target="_blank" &gt;Chess Online Blog&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://personalwebsiteblog.blogspot.com/" target="_blank" &gt;Appliblog&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Let's get started:&lt;/b&gt; &lt;br /&gt;We need a means of taking information from a SQL database and turn it into &lt;b&gt;Java&lt;/b&gt; objects, and vice-versa. The general problem is known as Object/Relational Mapping. &lt;b&gt;Hibernate&lt;/b&gt; is a lightweight O/R mapping service for &lt;b&gt;Java&lt;/b&gt; and gives you the means for persisting your &lt;b&gt;Java&lt;/b&gt; objects to and from an underlying database. Rather than you writing the SQL and converting queries to and from first class objects, &lt;b&gt;Hibernate&lt;/b&gt; can take care of all this for you. You only concern yourself with the objects, &lt;b&gt;Hibernate&lt;/b&gt; worries about the SQL and making sure things end up in the right tables. &lt;br /&gt;&lt;br /&gt;There are many books and articles available on &lt;b&gt;Hibernate&lt;/b&gt; and what I want to do here is quickly get you started with &lt;b&gt;Hibernate&lt;/b&gt;. I want to take this opportunity to thank Glen Smith for showing me the quick way to get started with &lt;b&gt;Hibernate&lt;/b&gt; and this blog is based on that and dedicated to him.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Quick Installation and Setup:&lt;/b&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Install &lt;b&gt;J2SDK&lt;/b&gt; 1.4.2&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Install Ant&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Go to http://www.hibernate.org/ and download &lt;b&gt;Hibernate&lt;/b&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Install &lt;b&gt;Hibernate&lt;/b&gt; by unzipping the file hibernate-2.1.6.zip to drive say F:&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Setup a Project Hierarchy by doing the following. Create folder F:hlogin and then create sub-folders F:hloginsrc and F:hloginlib&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Copy all the contents of F:hibernate-2.1lib to F:hloginlib&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Copy hibernate2.jar to F:hloginlib&lt;/li&gt;&lt;br /&gt;&lt;li&gt;The example classes we are going to create are all going to reside in the folder F:hloginsrccomtalimdemo. Create these sub-folders.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;b&gt;Quick Compile:&lt;/b&gt;&lt;br /&gt;To quickly compile your Java code:&lt;br /&gt;At the folder F:hlogin type &lt;b&gt;ant&lt;/b&gt; &lt;br /&gt;&lt;br /&gt;&lt;b&gt;To run your Hibernate programs:&lt;/b&gt;&lt;br /&gt;At the folder F:hlogin type &lt;b&gt;ant run&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Resource&lt;/b&gt; - &lt;b&gt;&lt;a href="http://indicthreads.com/content/blogs/hibernate/build.xml" target="_blank" &gt;build.xml&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;The Development Process:&lt;/b&gt;&lt;br /&gt;There are several ways to approach Hibernate development. Here's the one that is probably the most straightforward to understand:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Create your SQL table to hold your persistent objects&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Create a &lt;b&gt;Java&lt;/b&gt; bean that will represent that object in code&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Create a mapping file that &lt;b&gt;Hibernate&lt;/b&gt; knows which bean properties map to which SQL fields&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Create a properties file so &lt;b&gt;Hibernate&lt;/b&gt; knows your JDBC settings to get to the database&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Start using the &lt;b&gt;Hibernate&lt;/b&gt; API&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;As you get more proficient, there are tools to help auto-generate either Beans from SQL or SQL from Beans (and even plug-ins to make the mapping file for you), but let's do it the long way first, so you don't get distracted. &lt;br /&gt;&lt;br /&gt;To be continued...&lt;hr  style="color:silver;" /&gt;&lt;span class="technoratitag"&gt;&lt;b&gt;Technorati Tags: &lt;a href="http://technorati.com/tag/Quick+Hibernate" rel="tag"&gt;Quick Hibernate&lt;/a&gt;, &lt;a href="http://technorati.com/tag/Hibernate" rel="tag"&gt;Hibernate&lt;/a&gt;&lt;a href="http://technorati.com/tag/Java" rel="tag"&gt;&lt;/a&gt;&lt;a href="http://technorati.com/tag/J2EE" rel="tag"&gt;&lt;/a&gt;&lt;a href="http://technorati.com/tag/Blogs" rel="tag"&gt;&lt;/a&gt;&lt;a href="http://technorati.com/tag/PuneBlogs" rel="tag"&gt;&lt;/a&gt;&lt;a href="http://technorati.com/tag/Blogosphere" rel="tag"&gt;&lt;/a&gt;&lt;a href="http://technorati.com/tag/Pune" rel="tag"&gt;&lt;/a&gt;&lt;a href="http://technorati.com/tag/Media" rel="tag"&gt;&lt;/a&gt;&lt;a href="http://technorati.com/tag/RSS" rel="tag"&gt;&lt;/a&gt;&lt;a href="http://technorati.com/tag/Marketing" rel="tag"&gt;&lt;/a&gt;&lt;a href="http://technorati.com/tag/News" rel="tag"&gt;&lt;/a&gt;&lt;a href="http://technorati.com/tag/IndianGuru" rel="tag"&gt;&lt;/a&gt;&lt;a href="http://technorati.com/tag/Blogging" rel="tag"&gt;&lt;/a&gt;&lt;a href="http://technorati.com/tag/Internet" rel="tag"&gt;&lt;/a&gt;&lt;a href="http://technorati.com/tag/Blog" rel="tag"&gt;&lt;/a&gt;&lt;a href="http://technorati.com/tag/SatishTalim" rel="tag"&gt;&lt;/a&gt;&lt;a href="http://technorati.com/tag/Satish+Talim" rel="tag"&gt;&lt;/a&gt;&lt;a href="http://technorati.com/tag/Weblog" rel="tag"&gt;&lt;/a&gt;&lt;a href="http://technorati.com/tag/Weblogs" rel="tag"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href=""&gt;Blogs linking to this article&lt;/a&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17356771-112822879647245204?l=quickhibernate.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://quickhibernate.blogspot.com/feeds/112822879647245204/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17356771&amp;postID=112822879647245204' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17356771/posts/default/112822879647245204'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17356771/posts/default/112822879647245204'/><link rel='alternate' type='text/html' href='http://quickhibernate.blogspot.com/2005/10/quick-hibernate-part-1.html' title='Quick Hibernate - Part 1'/><author><name>Swati Talim</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
