This week's book giveaway is in the Agile and Other Processes forum. We're giving away four copies of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java and have Dr. Raoul-Gabriel Urma & Richard Warburton on-line! See this thread for details.
In practice, there's no difference.
In theory, JavaBeans follow the JavaBean conventions. POJOs have no such requirement.
However, since you mentioned Spring POJOs (no such thing, by the way: POJOs are by definition not related to any specific API or framework), Spring makes use of the JavaBean conventions for accessor methods in the IOC container). So spring-managed POJOs should follow the JavaBean convention in order to be properly configurable via Spring.
JavaBean have to follow the JavaBean spec to be called java beans, POJO's there is no such req, pojos are plain old java objects
posted 10 years ago
As i know Hibernate Persists both Java Beans/POJO.
While Java Beans have few Restrictions:
1) NO Argument Constructor
2) Must Implements java.io.Serilizable Interface
3) It should not extend any special Base Class
4) It should contain the getter and Setter Methods for instance variables with Naming Convention.
However these rules doesn't affect Hibernate Persistnce Ability to Java Beans.
While Hibernate Persists those POJO Which must have a default Constructor.
Hibernate does not require the POJOs or JavaBeans to implement any special interface or extend any special
sub-class. This is one of the features that distinguish Hibernate from some of the other persistent frameworks.
In fact, Hibernate does not even require persistent classes to implement Serializable as the JavaBean spec
Persistent classes do not need to import or use any Hibernate packages.
Get meta with me! What pursues us is our own obsessions! But not this tiny ad: