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.
Win a copy of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

how pojo is different from Normal Java Beans ?

 
Ranch Hand
Posts: 397
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

What makes the Spring POJO Object different from the normal Java Beans Object.'


Regards,
Prabhat
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nothing.
 
Marshal
Posts: 67357
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
POJO == plain old Java object

In other words, one without special semantics like an Enterprise bean or servlet.

So "normal" JavaBeans are a good example of a POJO.
 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 85
Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Prabhat Ranjan
Ranch Hand
Posts: 397
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
requires.

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:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!