Skip to content

Instantly share code, notes, and snippets.

@ledangtuanbk
Last active August 23, 2019 03:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ledangtuanbk/3d87e139dd3204e6c8df0a985a43bb3e to your computer and use it in GitHub Desktop.
Save ledangtuanbk/3d87e139dd3204e6c8df0a985a43bb3e to your computer and use it in GitHub Desktop.
1. jpa-entity-class
- @javax.persistance.Entity
- public, protected no-argument contructor
- class not declare final, no method, persistence instance variables is final.
- if an entity is passed by value as detached object. such as through a session bean remote. class must by implementaion Serialization
- Entity may extends both entity and non-entity class.
- fields: not annotated
2. Class Level architecture
https://2.bp.blogspot.com/-zQCYV-qJCU0/XAPuPHYDHSI/AAAAAAAAFEs/B2_uskqyAss_ZPX_EzsJujEYtirEtu49gCLcBGAs/s1600/jpa_class_level_architecture.png
- Entity Manager Factory: It creates and manages multiple Entity Manager
- Entity Manager: It's interface, it manages the persistence operations on objects. It works like a factory for Query instacnce
-
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment