Sunday, May 8, 2011

Entity in ORM

Entity is the persistence (POJO) objects that represent one record in the table. The Entity is simple annoted POJO class, which is easy to develop. Here are the characteristics of an Entity:
  1. Entity can be persisted to the relational database
  2. Entity is identified by persistence identity (the primary key of the table)
  3. Entity supports transactions
  4. Entity supports inheritance
Example consider this class:
class MobileEntity{

    private String model;
    private String manufacturer;
    private Double price;
      private String imeiNo;

    // Getters and Setters go here.
See Entity in JPA.

No comments:

Post a Comment