Book Image

Spring Persistence with Hibernate

By : Ahmad Seddighi
Book Image

Spring Persistence with Hibernate

By: Ahmad Seddighi

Overview of this book

<p>Spring is the leading platform to build and run enterprise Java applications. Spring's Hibernate integration makes it easy to mix and match persistence methodologies simplifying your Hibernate applications. You can incorporate lots of Inversion of Control (IoC) convenience features to address many typical Hibernate integration issues, making this integration all the more favorable for your application. <br /><br />This easy-to-use book will turn the complex-sounding integration into a straightforward walk-through. Persistence is important for creating a data access-based transactions tier, central to financial, insurance, and banking applications. You will be able to enhance your applications using the most common, advanced, and optional features of Hibernate.<br /><br />This book starts with the philosophy and the brief history of persistence. It provides an introduction to how persistence frameworks and technologies came into the development scene and what problems they are aimed to solve.<br /><br />The book continues with a discussion about Hibernate as the most popular persistence framework in Java. First, you will learn how to get Hibernate and add it to a project and how to configure it before it can be used. Next, you will get an in-depth knowledge about Hibernate and understand the essential concepts behind persistence with Hibernate and more. When Hibernate has been fully discussed, you will get to know Spring as another popular framework in Java, and have a look at essential features of Spring and its added value for Hibernate-based projects. Finally the book will provide a comprehensive discussion about using Hibernate with Spring and the problems that are solved with Spring.</p>
Table of Contents (22 chapters)
Spring Persistence with Hibernate
Credits
About the Author
About the Reviewer
Preface
Index

Summary


Unit testing, a critical part of application development, ensures that the application works as expected. A good practice for unit testing is to execute test classes automatically.

A test class is implemented for each Java class. Each test class includes the required methods for testing an application class in isolation from other application and test classes.

JUnit is a Java framework that simplifies test development. Using JUnit, you can easily verify that the method invocation results match the expected values. Extensions exist for the JUnit framework, such as Cactus, JMeter, DbUnit, HttpUnit, and so on.

To implement a test class with JUnit 3.8 and before, you only need to create a subclass of TestCase, and then implement the initialization process in the setUp() method and the finalization process in the tearDown() method. Then, implement the test methods, whose names begin with the test prefix. With JUnit 4 or later, you can simply use any class as a test class. In the test class...