Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

entity class is a Javabean?

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Everybody!!!

I am newbie for learning J2EE and still many concepts confuses me. I found a entity class looks like a javabean.

1 Is an entity class javabean? (please explain something here... )
2 what the relationship between entity class and JPA? (my understanding: is JPA a tech/API used with entity class, which persists the data from database?)

Thank you guys!!
 
Ranch Hand
Posts: 544
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
1. Since EJB 3.0, Entity Bean is modeled as a POJOs (Plain old Java Object). These are in a way simple Java beans with fields and their getters/setters encapsulated in it. However using JPA annotations makes it special and they are then called as JPA Entities. I am not sure if you have looked at the Entity beans prior to 3.0 specifications. That will be helpful to appreciate the change the specifications made to Entities.
2. I believe #1 pretty much says about the relationship between Entities and JPA. Using JPA annotations or deployment descriptor based configuration, you can persist the entities in the database. It is not only about persistence though, lot many things are also going on in the background. JPA helps you map the Java Objects to Relational database tables. You can refer ORM(Object Relational Mapping) to gain a better understanding. You can find this in any EJB or Hibernate reference material.

Hope this helps.

Regards,
Amit
 
Honk if you love justice! And honk twice for tiny ads!
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic