This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.behindjava.entity; | |
| import javax.persistence.Column; | |
| import javax.persistence.Entity; | |
| import javax.persistence.GeneratedValue; | |
| import javax.persistence.Id; | |
| import javax.persistence.Table; | |
| @Entity | |
| @Table(name="EMPLOYEE") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |
| <modelVersion>4.0.0</modelVersion> | |
| <groupId>com.behindjava.app</groupId> | |
| <artifactId>Spring3HibernateIntegration</artifactId> | |
| <packaging>war</packaging> | |
| <version>1.0-SNAPSHOT</version> | |
| <name>Spring3HibernateIntegration Maven Webapp</name> | |
| <url>http://maven.apache.org</url> | |
| <!-- JBoss repository for Hibernate --> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <import resource="main.xml"/> | |
| <import resource="scheduler.xml"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- A bean definition with prototype scope --> | |
| <bean id = "..." class = "..." scope = "prototype"> | |
| <!-- collaborators and configuration for this bean go here --> | |
| </bean> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- A bean definition with singleton scope --> | |
| <bean id = "..." class = "..." scope = "singleton"> | |
| <!-- collaborators and configuration for this bean go here --> | |
| </bean> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.behindjava; | |
| import org.springframework.beans.factory.BeanFactory; | |
| import org.springframework.beans.factory.xml.XmlBeanFactory; | |
| import org.springframework.core.io.*; | |
| public class Main { | |
| public static void main(String[] args) { | |
| Resource r=new ClassPathResource("applicationContext.xml"); | |
| BeanFactory factory=new XmlBeanFactory(r); | |
| MyBook b=(MyBook)factory.getBean("myBook"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <beans | |
| xmlns="http://www.springframework.org/schema/beans" | |
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| xmlns:p="http://www.springframework.org/schema/p" | |
| xsi:schemaLocation="http://www.springframework.org/schema/beans | |
| http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"> | |
| <bean id="myBook" class="com.behindjava.MyBook"> | |
| <property name="id"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.behindjava; | |
| public class MyBook { | |
| private int id; | |
| private String bookName; | |
| private String author; | |
| public int getId() { | |
| return id; | |
| } | |
| public void setId(int id) { | |
| this.id = id; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.behindjava; | |
| import org.springframework.beans.factory.BeanFactory; | |
| import org.springframework.beans.factory.xml.XmlBeanFactory; | |
| import org.springframework.core.io.*; | |
| public class Main { | |
| public static void main(String[] args) { | |
| Resource r=new ClassPathResource("applicationContext.xml"); | |
| BeanFactory factory=new XmlBeanFactory(r); | |
| MyBook b=(MyBook)factory.getBean("myBook"); | |
| b.display(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <beans | |
| xmlns="http://www.springframework.org/schema/beans" | |
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| xmlns:p="http://www.springframework.org/schema/p" | |
| xsi:schemaLocation="http://www.springframework.org/schema/beans | |
| http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"> | |
| <bean id="myBook" class="com.behindjava.MyBook"> | |
| <constructor-arg value="1" type="int"></constructor-arg> |