Nice example on how to get rid of superfluous code... The following implementation of equals, hashcode and toString is using the concept of one or more business keys defined by annotations.The annotation @BusinessKey can be applied with an include/exclude filter on field or method level.
Hibernate Annotations is my preferred way to map my entity classes, since they don't require any external file (thus keeping mapping info in your Java files), is fully integrated with all Hibernate mapping capabilities and Hibernate documentation encourages us to use this kind of configuration because it's more efficient.
Annotation driven mapping in Hibernate uses the standard JPA API annotations and introduce some specific extensions to deal with some Hibernate features. You can find a full reference in the official documentation.
jBPM (Java Business Process Management) is an open source Java framework for managing workflows.
This project provides:
* A simple standalone Eclipse project for checkout and experimentation
* Example jBPM integration with Hibernate, Spring, and Oracle XE (a free download)
* Simple JUnit tests for leaning by doing
* A companion powerpoint presentation in the downloads section
* How-Tos in this Wiki
With the addition of generics in Java 5, writing a custom DAO for each domain object is no longer required. There are a wide variety of articles on creating generic DAOs, but my current project uses the approach from this IBM DeveloperWorks article. This approach was choses mainly because of the clearly written article and the integration with Spring. You should be able to extend any generic DAO based on Spring to implement the stored procedure configuration.
Thought I've bookmarked this a long time ago... "With the adoption of Java™ 5 generics, the idea of a generic typesafe Data Access Object (DAO) implementation has become feasible. In this article, system architect Per Mellqvist presents a generic DAO implementation class based on Hibernate. He then shows you how to use Spring AOP introductions to add a typesafe interface to the class for query execution."
About
AutoDAO is a Generic DAO on steroids implementation for Java.
This project was inspired by Don't repeat the DAO! article by Per Mellqvist.
Main features
* Ready to use CRUD operations
* Zero persistence code for common DAO queries
* Annotation-driven auto-configuration
* Spring Framework custom namespace for easy to use configuration
* Hibernate/JPA support
PathProxy is a design pattern for persisting complex relationships without cluttering up your database. In this article JavaWorld contributor Matthew Tyson introduces his PathProxy pattern and walks you through an example application implementation based on Spring, JSF, and JPA/Hibernate.
The goal of Autofetch is reduce the modularity penalty and programmer burden of specifying associations which should be loaded with an object query. These specifications are sometimes are called fetch profiles, prefetch directives, or joins. These specifications are an important performance optimization because they reduce the number of round-trips to a persistence store whether that be a relational database, object database, or flat file. Autofetch is a library which integrates with object persistence tools and automatically handles prefetching data. Using dynamic program profiling, Autofetch determines the right prefetch directives for each query a program executes.
As also described in the Hibernate book from King and Bauer: "With the adoption of Java™ 5 generics, the idea of a generic typesafe Data Access Object (DAO) implementation has become feasible. In this article, system architect Per Mellqvist presents a generic DAO implementation class based on Hibernate. He then shows you how to use Spring AOP introductions to add a typesafe interface to the class for query execution."
Hibernate Synchronizer is a free Eclipse plugin code generation tool to be used with the Hibernate persistence framework. The plugin will automatically generate java code when your hibernate mapping files are modified. Objects are created with generated code in an abstract base class and a user-modifiable extension class so user code does not get deleted when the generation is performed.
The automaticallly generated objects include:
* Value Objects
* Proxy Interfaces
* Composite Key Objects
* Enumeration Objects
* Component Objects
* Subclasses
* DAOs
Other features include:
* Editor with code assist and outline view
* Custom template generation
* New mapping file wizard that queries your database
* New configuration file wizard
* Actions for adding mapping references, synchronizing files, and manually activating code generation