{"id":2317,"date":"2017-05-17T15:10:59","date_gmt":"2017-05-17T15:10:59","guid":{"rendered":"http:\/\/codethataint.com\/blog\/?p=2317"},"modified":"2017-05-17T15:48:31","modified_gmt":"2017-05-17T15:48:31","slug":"annotationsessionfactorybean-spring","status":"publish","type":"post","link":"https:\/\/codethataint.com\/blog\/annotationsessionfactorybean-spring\/","title":{"rendered":"AnnotationSessionFactoryBean Spring"},"content":{"rendered":"<ol>\n<li>AnnotationSessionFactoryBean is used to create session factory if hibernate pojo are annotated<\/li>\n<li>AnnotationSessionFactoryBean is a factory that produces SessionFactory automatically.This is used when you create a sessionFactory object of Hibernate from Spring\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\n &lt;bean id=&quot;sessionFactory&quot; class=&quot;org.springframework.orm.hibernate3.\r\nannotation.AnnotationSessionFactoryBean&quot;&gt;\r\n   &lt;property name=&quot;dataSource&quot; ref=&quot;dataSource&quot;\/&gt;\r\n   &lt;property name=&quot;annotatedClasses&quot;&gt;\r\n     &lt;list&gt;\r\n       &lt;value&gt;test.package.Foo&lt;\/value&gt;\r\n       &lt;value&gt;test.package.Bar&lt;\/value&gt;\r\n     &lt;\/list&gt;\r\n   &lt;\/property&gt;\r\n &lt;\/bean&gt;\r\n<\/pre>\n<\/li>\n<li>This session factory is assigned to all dao beans and hibernate template to do database transaction.\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\n&lt;bean id=&quot;hibernateTemplate&quot; class=&quot;org.springframework.orm.hibernate3.\r\nHibernateTemplate&quot;&gt;\r\n\t&lt;property name=&quot;sessionFactory&quot;&gt;\r\n\t  &lt;ref bean=&quot;sessionFactory&quot; \/&gt;\r\n\t&lt;\/property&gt;\r\n&lt;\/bean&gt;\r\n&lt;bean id=&quot;pageDao&quot; class=&quot;com.concretepage.dao.PageDaoImpl&quot;&gt;\r\n    &lt;property name=&quot;hibernateTemplate&quot;&gt;\r\n\t  &lt;ref bean=&quot;hibernateTemplate&quot; \/&gt;\r\n\t&lt;\/property&gt;\r\n&lt;\/bean&gt;\r\n<\/pre>\n<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>AnnotationSessionFactoryBean is used to create session factory if hibernate pojo are annotated AnnotationSessionFactoryBean is a factory that produces SessionFactory automatically.This is used when you create a sessionFactory object of Hibernate from Spring &lt;bean id=&quot;sessionFactory&quot; class=&quot;org.springframework.orm.hibernate3. annotation.AnnotationSessionFactoryBean&quot;&gt; &lt;property name=&quot;dataSource&quot; ref=&quot;dataSource&quot;\/&gt; &lt;property name=&quot;annotatedClasses&quot;&gt; &lt;list&gt; &lt;value&gt;test.package.Foo&lt;\/value&gt; &lt;value&gt;test.package.Bar&lt;\/value&gt; &lt;\/list&gt; &lt;\/property&gt; &lt;\/bean&gt; This session factory is assigned to all dao&hellip; <a href=\"https:\/\/codethataint.com\/blog\/annotationsessionfactorybean-spring\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[188],"tags":[],"class_list":["post-2317","post","type-post","status-publish","format-standard","hentry","category-spring"],"_links":{"self":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/2317","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/comments?post=2317"}],"version-history":[{"count":7,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/2317\/revisions"}],"predecessor-version":[{"id":2324,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/2317\/revisions\/2324"}],"wp:attachment":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/media?parent=2317"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/categories?post=2317"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/tags?post=2317"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}