<?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:blogger='http://schemas.google.com/blogger/2008' 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>2024-02-20T13:47:40.902-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?alt=atom'/><link rel='alternate' type='text/html' href='http://quickhibernate.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11893078648375764557</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.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>25</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=&quot;font-family: verdana, arial, sans-serif; line-height:12px; font-size: 11px; text-align: justify;&quot;&gt;&lt;b&gt;&lt;a href=&quot;http://www.hibernate.org/&quot; target=&quot;_blank&quot; &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&#39;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;&quot;Quick Hibernate&quot;&lt;/b&gt; article, Satish Talim gets you started with &lt;b&gt;Hibernate&lt;/b&gt;. Satish&#39;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=&quot;http://indicthreads.com/interviews/java_j2ee_today.html&quot; target=&quot;_blank&quot; &gt;Java and J2EE Today&lt;/a&gt;&lt;/b&gt;. This article appeared in &lt;b&gt;&lt;a href=&quot;http://weblogs.java.net/blog/editors/archives/2005/06/_making_a_diffe.html&quot; target=&quot;_blank&quot; &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=&quot;http://punejava.blogspot.com/&quot; target=&quot;_blank&quot; &gt;PuneJava&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;a href=&quot;http://satishtalim.blogspot.com/&quot; target=&quot;_blank&quot; &gt;Chess Online Blog&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;a href=&quot;http://personalwebsiteblog.blogspot.com/&quot; target=&quot;_blank&quot; &gt;Appliblog&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Let&#39;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=&quot;http://indicthreads.com/content/blogs/hibernate/build.xml&quot; target=&quot;_blank&quot; &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&#39;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&#39;s do it the long way first, so you don&#39;t get distracted. &lt;br /&gt;&lt;br /&gt;To be continued...&lt;hr  style=&quot;color:silver;&quot; /&gt;&lt;span class=&quot;technoratitag&quot;&gt;&lt;b&gt;Technorati Tags: &lt;a href=&quot;http://technorati.com/tag/Quick+Hibernate&quot; rel=&quot;tag&quot;&gt;Quick Hibernate&lt;/a&gt;, &lt;a href=&quot;http://technorati.com/tag/Hibernate&quot; rel=&quot;tag&quot;&gt;Hibernate&lt;/a&gt;&lt;a href=&quot;http://technorati.com/tag/Java&quot; rel=&quot;tag&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://technorati.com/tag/J2EE&quot; rel=&quot;tag&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://technorati.com/tag/Blogs&quot; rel=&quot;tag&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://technorati.com/tag/PuneBlogs&quot; rel=&quot;tag&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://technorati.com/tag/Blogosphere&quot; rel=&quot;tag&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://technorati.com/tag/Pune&quot; rel=&quot;tag&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://technorati.com/tag/Media&quot; rel=&quot;tag&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://technorati.com/tag/RSS&quot; rel=&quot;tag&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://technorati.com/tag/Marketing&quot; rel=&quot;tag&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://technorati.com/tag/News&quot; rel=&quot;tag&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://technorati.com/tag/IndianGuru&quot; rel=&quot;tag&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://technorati.com/tag/Blogging&quot; rel=&quot;tag&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://technorati.com/tag/Internet&quot; rel=&quot;tag&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://technorati.com/tag/Blog&quot; rel=&quot;tag&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://technorati.com/tag/SatishTalim&quot; rel=&quot;tag&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://technorati.com/tag/Satish+Talim&quot; rel=&quot;tag&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://technorati.com/tag/Weblog&quot; rel=&quot;tag&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://technorati.com/tag/Weblogs&quot; rel=&quot;tag&quot;&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;&quot;&gt;Blogs linking to this article&lt;/a&gt;&lt;/b&gt;&lt;/span&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/fullpage/post/17356771/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>Anonymous</name><uri>http://www.blogger.com/profile/11893078648375764557</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>