Commit 0330bdb3 authored by Darrick Yong's avatar Darrick Yong

first commit with post/edit/delete

parents
File added
/target
\ No newline at end of file
# Default ignored files
/shelf/
/workspace.xml
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<annotationProcessing>
<profile name="Maven default annotation processors profile" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="nisum-workshop" />
</profile>
</annotationProcessing>
<bytecodeTargetLevel>
<module name="nisum-workshop" target="1.8" />
</bytecodeTargetLevel>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="https://repo.maven.apache.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
</component>
</project>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: antlr:antlr:2.7.7">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/antlr/antlr/2.7.7/antlr-2.7.7.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/antlr/antlr/2.7.7/antlr-2.7.7-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/antlr/antlr/2.7.7/antlr-2.7.7-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: com.h2database:h2:1.3.165">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/h2database/h2/1.3.165/h2-1.3.165.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/com/h2database/h2/1.3.165/h2-1.3.165-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/com/h2database/h2/1.3.165/h2-1.3.165-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: dom4j:dom4j:1.6.1">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/dom4j/dom4j/1.6.1/dom4j-1.6.1-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/dom4j/dom4j/1.6.1/dom4j-1.6.1-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: javax.servlet:jstl:1.2">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/javax/servlet/jstl/1.2/jstl-1.2.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/javax/servlet/jstl/1.2/jstl-1.2-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/javax/servlet/jstl/1.2/jstl-1.2-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: junit:junit:3.8.1">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/junit/junit/3.8.1/junit-3.8.1.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/junit/junit/3.8.1/junit-3.8.1-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/junit/junit/3.8.1/junit-3.8.1-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.hibernate.common:hibernate-commons-annotations:4.0.4.Final">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/hibernate/common/hibernate-commons-annotations/4.0.4.Final/hibernate-commons-annotations-4.0.4.Final.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/hibernate/common/hibernate-commons-annotations/4.0.4.Final/hibernate-commons-annotations-4.0.4.Final-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/hibernate/common/hibernate-commons-annotations/4.0.4.Final/hibernate-commons-annotations-4.0.4.Final-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.hibernate:hibernate-core:4.3.5.Final">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/hibernate/hibernate-core/4.3.5.Final/hibernate-core-4.3.5.Final.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/hibernate/hibernate-core/4.3.5.Final/hibernate-core-4.3.5.Final-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/hibernate/hibernate-core/4.3.5.Final/hibernate-core-4.3.5.Final-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.hibernate:hibernate-entitymanager:4.3.5.Final">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/hibernate/hibernate-entitymanager/4.3.5.Final/hibernate-entitymanager-4.3.5.Final.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/hibernate/hibernate-entitymanager/4.3.5.Final/hibernate-entitymanager-4.3.5.Final-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/hibernate/hibernate-entitymanager/4.3.5.Final/hibernate-entitymanager-4.3.5.Final-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/hibernate/javax/persistence/hibernate-jpa-2.1-api/1.0.0.Final/hibernate-jpa-2.1-api-1.0.0.Final.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/hibernate/javax/persistence/hibernate-jpa-2.1-api/1.0.0.Final/hibernate-jpa-2.1-api-1.0.0.Final-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/hibernate/javax/persistence/hibernate-jpa-2.1-api/1.0.0.Final/hibernate-jpa-2.1-api-1.0.0.Final-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.javassist:javassist:3.18.1-GA">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/javassist/javassist/3.18.1-GA/javassist-3.18.1-GA.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/javassist/javassist/3.18.1-GA/javassist-3.18.1-GA-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/javassist/javassist/3.18.1-GA/javassist-3.18.1-GA-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.jboss:jandex:1.1.0.Final">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/jboss/jandex/1.1.0.Final/jandex-1.1.0.Final.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/jboss/jandex/1.1.0.Final/jandex-1.1.0.Final-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/jboss/jandex/1.1.0.Final/jandex-1.1.0.Final-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.jboss.logging:jboss-logging:3.1.3.GA">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/jboss/logging/jboss-logging/3.1.3.GA/jboss-logging-3.1.3.GA.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/jboss/logging/jboss-logging/3.1.3.GA/jboss-logging-3.1.3.GA-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/jboss/logging/jboss-logging/3.1.3.GA/jboss-logging-3.1.3.GA-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.jboss.logging:jboss-logging-annotations:1.2.0.Beta1">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/jboss/logging/jboss-logging-annotations/1.2.0.Beta1/jboss-logging-annotations-1.2.0.Beta1.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/jboss/logging/jboss-logging-annotations/1.2.0.Beta1/jboss-logging-annotations-1.2.0.Beta1-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/jboss/logging/jboss-logging-annotations/1.2.0.Beta1/jboss-logging-annotations-1.2.0.Beta1-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:1.0.0.Final">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/jboss/spec/javax/transaction/jboss-transaction-api_1.2_spec/1.0.0.Final/jboss-transaction-api_1.2_spec-1.0.0.Final.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/jboss/spec/javax/transaction/jboss-transaction-api_1.2_spec/1.0.0.Final/jboss-transaction-api_1.2_spec-1.0.0.Final-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/jboss/spec/javax/transaction/jboss-transaction-api_1.2_spec/1.0.0.Final/jboss-transaction-api_1.2_spec-1.0.0.Final-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.springframework:spring-aop:5.2.13.RELEASE">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-aop/5.2.13.RELEASE/spring-aop-5.2.13.RELEASE.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-aop/5.2.13.RELEASE/spring-aop-5.2.13.RELEASE-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-aop/5.2.13.RELEASE/spring-aop-5.2.13.RELEASE-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.springframework:spring-beans:5.2.13.RELEASE">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-beans/5.2.13.RELEASE/spring-beans-5.2.13.RELEASE.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-beans/5.2.13.RELEASE/spring-beans-5.2.13.RELEASE-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-beans/5.2.13.RELEASE/spring-beans-5.2.13.RELEASE-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.springframework:spring-context:5.2.13.RELEASE">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-context/5.2.13.RELEASE/spring-context-5.2.13.RELEASE.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-context/5.2.13.RELEASE/spring-context-5.2.13.RELEASE-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-context/5.2.13.RELEASE/spring-context-5.2.13.RELEASE-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.springframework:spring-core:5.2.13.RELEASE">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-core/5.2.13.RELEASE/spring-core-5.2.13.RELEASE.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-core/5.2.13.RELEASE/spring-core-5.2.13.RELEASE-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-core/5.2.13.RELEASE/spring-core-5.2.13.RELEASE-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.springframework:spring-expression:5.2.13.RELEASE">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-expression/5.2.13.RELEASE/spring-expression-5.2.13.RELEASE.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-expression/5.2.13.RELEASE/spring-expression-5.2.13.RELEASE-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-expression/5.2.13.RELEASE/spring-expression-5.2.13.RELEASE-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.springframework:spring-jcl:5.2.13.RELEASE">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-jcl/5.2.13.RELEASE/spring-jcl-5.2.13.RELEASE.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-jcl/5.2.13.RELEASE/spring-jcl-5.2.13.RELEASE-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-jcl/5.2.13.RELEASE/spring-jcl-5.2.13.RELEASE-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.springframework:spring-jdbc:5.2.13.RELEASE">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-jdbc/5.2.13.RELEASE/spring-jdbc-5.2.13.RELEASE.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-jdbc/5.2.13.RELEASE/spring-jdbc-5.2.13.RELEASE-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-jdbc/5.2.13.RELEASE/spring-jdbc-5.2.13.RELEASE-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.springframework:spring-orm:5.2.13.RELEASE">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-orm/5.2.13.RELEASE/spring-orm-5.2.13.RELEASE.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-orm/5.2.13.RELEASE/spring-orm-5.2.13.RELEASE-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-orm/5.2.13.RELEASE/spring-orm-5.2.13.RELEASE-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.springframework:spring-tx:5.2.13.RELEASE">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-tx/5.2.13.RELEASE/spring-tx-5.2.13.RELEASE.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-tx/5.2.13.RELEASE/spring-tx-5.2.13.RELEASE-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-tx/5.2.13.RELEASE/spring-tx-5.2.13.RELEASE-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.springframework:spring-web:5.2.13.RELEASE">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-web/5.2.13.RELEASE/spring-web-5.2.13.RELEASE.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-web/5.2.13.RELEASE/spring-web-5.2.13.RELEASE-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-web/5.2.13.RELEASE/spring-web-5.2.13.RELEASE-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.springframework:spring-webmvc:5.2.13.RELEASE">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-webmvc/5.2.13.RELEASE/spring-webmvc-5.2.13.RELEASE.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-webmvc/5.2.13.RELEASE/spring-webmvc-5.2.13.RELEASE-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-webmvc/5.2.13.RELEASE/spring-webmvc-5.2.13.RELEASE-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: xml-apis:xml-apis:1.0.b2">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/pom.xml" />
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK" />
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/nisum-workshop.iml" filepath="$PROJECT_DIR$/nisum-workshop.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.2.13.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.2.13.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.2.13.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-core:5.2.13.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.2.13.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.2.13.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.2.13.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-web:5.2.13.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-orm:5.2.13.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.2.13.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.2.13.RELEASE" level="project" />
<orderEntry type="library" name="Maven: javax.servlet:jstl:1.2" level="project" />
<orderEntry type="library" name="Maven: org.hibernate:hibernate-entitymanager:4.3.5.Final" level="project" />
<orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.1.3.GA" level="project" />
<orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging-annotations:1.2.0.Beta1" level="project" />
<orderEntry type="library" name="Maven: org.hibernate:hibernate-core:4.3.5.Final" level="project" />
<orderEntry type="library" name="Maven: antlr:antlr:2.7.7" level="project" />
<orderEntry type="library" name="Maven: org.jboss:jandex:1.1.0.Final" level="project" />
<orderEntry type="library" name="Maven: dom4j:dom4j:1.6.1" level="project" />
<orderEntry type="library" name="Maven: xml-apis:xml-apis:1.0.b2" level="project" />
<orderEntry type="library" name="Maven: org.hibernate.common:hibernate-commons-annotations:4.0.4.Final" level="project" />
<orderEntry type="library" name="Maven: org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final" level="project" />
<orderEntry type="library" name="Maven: org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:1.0.0.Final" level="project" />
<orderEntry type="library" name="Maven: org.javassist:javassist:3.18.1-GA" level="project" />
<orderEntry type="library" name="Maven: com.h2database:h2:1.3.165" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:3.8.1" level="project" />
</component>
</module>
\ No newline at end of file
<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.nisum</groupId>
<artifactId>nisum-workshop</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>nisum-workshop</name>
<url>http://maven.apache.org</url>
<properties>
<spring-version>5.2.13.RELEASE</spring-version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring-version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring-version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${spring-version}</version>
</dependency>
<!-- renders views-->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>4.3.5.Final</version>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.3.165</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<server>mytomcat7</server>
<path>/</path>
</configuration>
</plugin>
</plugins>
</build>
</project>
File added
package com.nisum;
import com.nisum.config.AppConfig;
import com.nisum.helper.EmployeeHelper;
import com.nisum.model.Employee;
import com.nisum.model.JobRole;
import com.nisum.model.impl.Contractor;
import com.nisum.model.impl.EmployeeImp;
import com.nisum.model.impl.JobRoleImp;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
* Hello world!
*
*/
public class App
{
public static void main( String[] args )
{
// traditionalApplicationFlow();
// applicationContextXmlConfig();
// applicationContextAnnotation();
}
public static void applicationContextAnnotation() {
ApplicationContext ctx = new AnnotationConfigApplicationContext(AppConfig.class);
EmployeeHelper employeeHelper = ctx.getBean(EmployeeHelper.class);
Employee emp1 = employeeHelper.createSoftwareEngineerEmployee("Vlad", "Rez");
Employee emp2 = employeeHelper.createSoftwareEngineerEmployee("John", "Smith");
List<Employee> employeeList = Arrays.asList(emp1, emp2);
employeeHelper.displayTeam(employeeList);
}
public static void applicationContextXmlConfig() {
ApplicationContext ctx = new ClassPathXmlApplicationContext("application-context.xml");
Employee emp1 = ctx.getBean("employeeJohn", EmployeeImp.class);
Employee emp2 = ctx.getBean("employeeWalter", EmployeeImp.class);
Employee emp3 = ctx.getBean("employeeJane", EmployeeImp.class);
List<Employee> employeeList = Arrays.asList(emp1, emp2, emp3);
String techTeam = employeeList.stream().map(employee ->
String.format("%s - %s", employee.getDisplayName(), employee.getJobRole().getTitle()))
.collect(Collectors.joining("\n"));
System.out.println(techTeam);
Contractor contractor1 = ctx.getBean("jobRoleContractor", Contractor.class);
Contractor contractor2 = ctx.getBean("jobRoleContractor", Contractor.class);
JobRole contractor3 = ctx.getBean("jobRoleContractor", Contractor.class);
JobRoleImp jobRoleImp = ctx.getBean("jobRoleSoftwareEngineerI", JobRoleImp.class);
jobRoleImp.setTitle("Sales");
String techTeam2 = employeeList.stream().map(employee ->
String.format("%s - %s", employee.getDisplayName(), employee.getJobRole().getTitle()))
.collect(Collectors.joining("\n"));
System.out.println(techTeam2);
contractor1.setTitle("Accounting");
System.out.printf("\n%s\n%s", contractor1.getTitle(), contractor2.getTitle());
}
public static void traditionalApplicationFlow() {
// Traditional Application Flow
JobRoleImp jobRole1 = new JobRoleImp("Software Engineer I");
JobRoleImp jobRole2 = new JobRoleImp("Software Engineer II");
JobRoleImp jobRole3 = new JobRoleImp("Tech Lead");
EmployeeImp employee1 = new EmployeeImp();
employee1.setFirstName("John");
employee1.setLastName("Smith");
employee1.setJobRole(jobRole1);
EmployeeImp employee2 = new EmployeeImp();
employee2.setFirstName("Walter");
employee2.setLastName("Bell");
employee2.setJobRole(jobRole2);
EmployeeImp employee3 = new EmployeeImp();
employee3.setFirstName("Jane");
employee3.setLastName("Doe");
employee3.setJobRole(jobRole3);
System.out.printf("\n%s %s %s\n",
employee1.getDisplayName(),
employee2.getDisplayName(),
employee3.getDisplayName());
}
}
package com.nisum.config;
import com.nisum.helper.EmployeeHelper;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
@Configuration
@ComponentScan("com.nisum")
public class AppConfig {
@Bean
public EmployeeHelper employeeHelper() {
return new EmployeeHelper();
}
}
package com.nisum.controller;
import com.nisum.dto.EmployeeDto;
import com.nisum.model.impl.EmployeeImp;
import com.nisum.service.EmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import java.util.Collection;
@Controller
public class EmployeeController {
@Autowired
EmployeeService employeeService;
@RequestMapping(value = "/", method = RequestMethod.GET)
public String index(Model model) {
Collection<EmployeeImp> employeeList = employeeService.getAllEmployees();
model.addAttribute("employees", employeeList);
model.addAttribute("employee", new EmployeeDto());
return "index";
}
@RequestMapping(value = "/new", method = RequestMethod.GET)
public String newEmployee(Model model) {
model.addAttribute("employee", new EmployeeDto());
return "new";
}
@RequestMapping(value = "/edit/{id}", method = RequestMethod.GET)
public String updateEmployee(@PathVariable("id") int employeeId, Model model) {
model.addAttribute("existingEmployee", employeeService.getEmployee(employeeId));
return "edit";
}
@RequestMapping(value = "/edit/{id}", method = RequestMethod.POST)
public String updateEmployee(@PathVariable("id") int employeeId, @ModelAttribute("updatedEmployee") EmployeeDto updatedEmployeeDto,
BindingResult bindingResult) {
employeeService.updateEmployee(employeeId, updatedEmployeeDto);
return "redirect:/";
}
@RequestMapping(value = "/create", method = RequestMethod.POST)
public String createEmployee(@ModelAttribute("employee") EmployeeDto employeeDto,
BindingResult bindingResult) {
employeeService.createEmployee(employeeDto);
return "redirect:/";
}
@RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
public String deleteEmployee(@PathVariable("id") int id) {
employeeService.deleteEmployee(id);
return "redirect:/";
}
}
package com.nisum.dao;
import java.util.Collection;
import java.util.Optional;
public interface Dao<T> {
Optional<T> getById(Integer id);
Collection<T> getAll();
void save(T t);
void update(T t);
void delete(T t);
}
package com.nisum.dao.impl;
import com.nisum.dao.Dao;
import com.nisum.model.impl.EmployeeImp;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.TypedQuery;
import java.util.Collection;
import java.util.Optional;
@Repository
@Qualifier("EmployeeDao")
@Transactional
public class EmployeeDao implements Dao<EmployeeImp> {
@PersistenceContext
private EntityManager entityManager;
@Override
public Optional<EmployeeImp> getById(Integer employeeId) {
// return Optional.of(entityManager.getReference(EmployeeImp.class, employeeId));
return Optional.of(entityManager.find(EmployeeImp.class, employeeId));
}
@Override
public Collection<EmployeeImp> getAll() {
TypedQuery<EmployeeImp> typedQuery = entityManager.createQuery("SELECT e FROM employee e", EmployeeImp.class);
return typedQuery.getResultList();
}
@Override
public void save(EmployeeImp employeeImp) {
entityManager.persist(employeeImp);
}
@Override
public void update(EmployeeImp employeeImp) {
employeeImp = entityManager.merge(employeeImp);
entityManager.persist(employeeImp);
}
@Override
public void delete(EmployeeImp employeeToDelete) {
employeeToDelete = entityManager.merge(employeeToDelete);
entityManager.remove(employeeToDelete);
}
}
package com.nisum.dto;
public class EmployeeDto {
String firstName;
String lastName;
String jobTitle;
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getJobTitle() {
return jobTitle;
}
public void setJobTitle(String jobTitle) {
this.jobTitle = jobTitle;
}
}
\ No newline at end of file
package com.nisum.helper;
import com.nisum.model.Employee;
import com.nisum.model.impl.EmployeeImp;
import com.nisum.model.impl.JobRoleImp;
import org.springframework.stereotype.Component;
import java.util.List;
import java.util.stream.Collectors;
@Component
public class EmployeeHelper {
public EmployeeImp createSoftwareEngineerEmployee(String fName, String lName) {
EmployeeImp employeeImp = new EmployeeImp();
employeeImp.setFirstName(fName);
employeeImp.setLastName(lName);
employeeImp.setJobRole(new JobRoleImp("Software Engineer"));
return employeeImp;
}
public void displayTeam(List<Employee> employeeList) {
String techTeam = employeeList.stream().map(employee ->
String.format("%s - %s", employee.getDisplayName(), employee.getJobRole().getTitle())).collect(Collectors.joining("\n"));
System.out.println(techTeam);
}
}
package com.nisum.model;
public interface Employee {
String getFirstName();
String getLastName();
String getDisplayName();
JobRole getJobRole();
}
package com.nisum.model;
public interface JobRole {
String getTitle();
}
package com.nisum.model.impl;
public class Contractor extends JobRoleImp {
public Contractor(String s) {
super(String.format("%s Contractor", s));
}
}
package com.nisum.model.impl;
import com.nisum.dto.EmployeeDto;
import com.nisum.model.Employee;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
@Table
@Entity(name="employee")
public class EmployeeImp implements Employee {
@Id
@GeneratedValue
private Integer id;
private String firstName;
private String lastName;
@Transient
private JobRoleImp jobRole;
public EmployeeImp() {
}
public void set(EmployeeDto newEmployee) {
this.firstName = newEmployee.getFirstName();
this.lastName = newEmployee.getLastName();
}
public String getFirstName() {
return firstName;
}
public String getLastName() {
return lastName;
}
public String getDisplayName() {
return String.format("%s%s",
this.firstName.toUpperCase().charAt(0),
this.lastName.toUpperCase());
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public JobRoleImp getJobRole() {
return jobRole;
}
public void setJobRole(JobRoleImp jobRole) {
this.jobRole = jobRole;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
}
package com.nisum.model.impl;
import com.nisum.model.JobRole;
public class JobRoleImp implements JobRole {
private String title;
public JobRoleImp(String title) {
this.title = title;
}
public String getTitle() {
return this.title;
}
public void setTitle(String title) {
this.title = title;
}
}
package com.nisum.service;
import com.nisum.dao.Dao;
import com.nisum.dto.EmployeeDto;
import com.nisum.model.Employee;
import com.nisum.model.impl.EmployeeImp;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import java.util.Collection;
import java.util.Optional;
@Service
public class EmployeeService {
@Autowired
@Qualifier(value = "EmployeeDao")
private Dao employeeDao;
public Collection<EmployeeImp> getAllEmployees() {
return employeeDao.getAll();
}
public EmployeeImp getEmployee(Integer employeeId) {
Optional<EmployeeImp> employee = employeeDao.getById(employeeId);
if (employee.isPresent()) {
return employee.get();
} else {
return new EmployeeImp();
}
}
public void createEmployee(EmployeeDto employee) {
EmployeeImp newEmployee = new EmployeeImp();
newEmployee.set(employee);
employeeDao.save(newEmployee);
}
public void updateEmployee(Integer employeeId, EmployeeDto updatedEmployee) {
Optional employeeToUpdate = employeeDao.getById(employeeId);
if (employeeToUpdate.isPresent()) {
EmployeeImp newEmployee = (EmployeeImp) employeeToUpdate.get();
newEmployee.set(updatedEmployee);
employeeDao.update(newEmployee);
}
}
public void deleteEmployee(Integer employeeId) {
Optional employeeToDelete = employeeDao.getById(employeeId);
if (employeeToDelete.isPresent()) {
employeeDao.delete(employeeToDelete.get());
}
}
}
<?xml version="1.0" encoding="UTF-8" ?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="jobRoleSoftwareEngineerI" class="com.nisum.model.impl.JobRoleImp">
<constructor-arg value="Software Engineer I"/>
</bean>
<bean id="jobRoleSoftwareEngineerII" class="com.nisum.model.impl.JobRoleImp">
<constructor-arg value="Software Engineer II"/>
</bean>
<bean id="jobRoleTechLead" class="com.nisum.model.impl.JobRoleImp">
<constructor-arg value="Tech Lead"/>
</bean>
<bean id="jobRoleContractor" scope="prototype" class="com.nisum.model.impl.Contractor">
<constructor-arg value="Software Engineer"/>
</bean>
<bean id="employeeJohn" class="com.nisum.model.impl.EmployeeImp">
<property name="firstName" value="John"/>
<property name="lastName" value="Smith"/>
<property name="jobRole" ref="jobRoleSoftwareEngineerI"/>
</bean>
<bean id="employeeWalter" class="com.nisum.model.impl.EmployeeImp">
<property name="firstName" value="Walter"/>
<property name="lastName" value="Bell"/>
<property name="jobRole" ref="jobRoleSoftwareEngineerII"/>
</bean>
<bean id="employeeJane" class="com.nisum.model.impl.EmployeeImp">
<property name="firstName" value="Jane"/>
<property name="lastName" value="Doe"/>
<property name="jobRole" ref="jobRoleTechLead"/>
</bean>
</beans>
\ No newline at end of file
INSERT INTO public.employee values (1, 'Vlad', 'Rez')
INSERT INTO public.employee values (2, 'John', 'Smith')
INSERT INTO public.employee values (3, 'Jane', 'Doe')
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:mvc ="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<!-- DispatcherServlet Context: defines this servlet's request-processing infrastructure -->
<!-- Enables the Spring MVC @Controller programming model -->
<mvc:annotation-driven/>
<!-- Resolves views selected for rendering by @Controllers to .jsp resources in the /WEB-INF/views directory -->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/views/" />
<property name="suffix" value=".jsp" />
</bean>
<!-- Where to look for to get @Component -->
<context:component-scan base-package="com.nisum.controller" />
</beans>
\ No newline at end of file
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Employee Service</title>
</head>
<body>
This is the Edit Page
<form:form action="/edit/${existingEmployee.id}" method="POST" modelAttribute="existingEmployee">
<form:label path="firstName">First Name</form:label>
<form:input path="firstName" value="${existingEmployee.firstName}" />
<form:label path="lastName">Last Name</form:label>
<form:input path="lastName" value="${existingEmployee.lastName}" />
<input type="submit" value="Update Employee" />
</form:form>
</body>
</html>
\ No newline at end of file
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Employee Service</title>
</head>
<body>
This is the Index Page
<a href="/new">Create New Employee, or use below form</a>
<table>
<c:forEach var="employee" items="${employees}">
<tr>
<td>
<c:out value="EMP #${employee.id}: ${employee.displayName}">
</c:out>
<a href="/edit/${employee.id}">Edit This User</a>
<form:form action="/delete/${employee.id}" method="POST">
<button>Delete this user</button>
</form:form>
</td>
</tr>
</c:forEach>
</table>
<br>
<br>
<form:form action="/create" method="POST" modelAttribute="employee">
<form:label path="firstName">First Name</form:label>
<form:input type="text" path="firstName" />
<form:label path="lastName">Last Name</form:label>
<form:input type="text" path="lastName" />
<input type="submit" value="Create New Employee" />
</form:form>
</body>
</html>
\ No newline at end of file
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Employee Service</title>
</head>
<body>
This is the New Page
<form:form action="/create" method="POST" modelAttribute="employee">
<form:label path="firstName">First Name</form:label>
<form:input type="text" path="firstName" />
<form:label path="lastName">Last Name</form:label>
<form:input type="text" path="lastName" />
<input type="submit" value="Create New Employee" />
</form:form>
</body>
</html>
\ No newline at end of file
<?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:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:jdbc="http://www.springframework.org/schema/jdbc"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
<!--resource visible to all other web components-->
<mvc:annotation-driven/>
<!-- Same as @ComponentScan("com.nisum")-->
<context:component-scan base-package="com.nisum" />
<!-- serves static resources-->
<mvc:resources mapping="/resources/**" location="/resources/" />
<!-- creates an embedded database instance as a bean -->
<jdbc:embedded-database id="dataSource" type="H2" />
<!-- creates a H2 database bean to be managed by the application context-->
<bean id="h2Server" class="org.h2.tools.Server" factory-method="createTcpServer" init-method="start" destroy-method="stop" depends-on="h2WebServer">
<constructor-arg value="-tcp,-tcpAllowOthers,-tcpPort,9093"/>
</bean>
<!-- creates a H2 webserver bean to be managed by the application context to access web based UI for sql commands-->
<bean id="h2WebServer" class="org.h2.tools.Server" factory-method="createWebServer" init-method="start" destroy-method="stop">
<constructor-arg value="-web,-webAllowOthers,-webPort,8082"/>
</bean>
<!-- Container managed entity manager, sets up instantiation of a EntityManager, an Entity Manger is basically a connection to a database -->
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="persistenceUnitName" value="EmpPU" />
<property name="dataSource" ref="dataSource" />
<property name="packagesToScan" >
<list>
<value>com.nisum.model</value>
</list>
</property>
<property name="persistenceProvider">
<bean class="org.hibernate.jpa.HibernatePersistenceProvider" />
</property>
<property name="jpaProperties">
<map>
<entry key="hibernate.dialect" value="org.hibernate.dialect.H2Dialect" />
<entry key="hibernate.hbm2ddl.auto" value="create" />
<entry key="hibernate.hbm2ddl.import_files" value="employee_data.sql" />
<entry key="hibernate.show_sql" value="true" />
<entry key="hibernate.enable_lazy_load_no_trans" value="true"/>
</map>
</property>
</bean>
<!-- Bean for a single JPA EntityManagerFactory (see above entityManagerFactory)-->
<bean id="transactionManager" scope="session" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory"/>
</bean>
<!-- Enable Annotation based Transaction Management, To make the @Transactional annotation work -->
<tx:annotation-driven transaction-manager="transactionManager"/>
</beans>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" version="2.5"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<!-- The definition of the Root Spring Container shared by all Servlets, basically provides parameters to the entire web application-->
<!--see https://docs.spring.io/spring-framework/docs/3.0.0.M3/reference/html/ch19s02.html-->
<context-param>
<!--param gives the location of the root context.-->
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/web-context.xml</param-value>
</context-param>
<!-- root web-application-context for the web-application and puts it in the ServletContext-->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!-- Processes application requests -->
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- specifies which java servlet should be invoked for a url-->
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
</web-app>
\ No newline at end of file
package com.nisum;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
/**
* Unit test for simple App.
*/
public class AppTest
extends TestCase
{
/**
* Create the test case
*
* @param testName name of the test case
*/
public AppTest( String testName )
{
super( testName );
}
/**
* @return the suite of tests being tested
*/
public static Test suite()
{
return new TestSuite( AppTest.class );
}
/**
* Rigourous Test :-)
*/
public void testApp()
{
assertTrue( true );
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment