Defining Entities
  • Entity classes have the @javax.persistence.Entity annotation
  • Must have public, no-arg constructor
  • Must be a top-level class (no inner class entities)
  • Must not be final and cannot contain final methods or variables
  • Instance variables cannot be accessed by "clients"; must use getters/setters
Entity Class Example