Java EE Components: Jpa, Ejb, JSF
Java EE Components: Jpa, Ejb, JSF
• A request enters the application through the control layer, • In Java EE platform, web components provide the dynamic
which will decide how the request should be handled and extension capabilities for a web server.
what information should be returned • Web components are either Java servlets, web pages, web service
endpoints, or JSP pages
@Id @GeneratedValue
• Object-Relational Mapping (ORM) • Entities are objects that live private Long id;
shortly in memory and
• Java Persistence API (JPA) persistently in a database.
@Column(nullable = false)
private String title;
private Float price;
• An API above JDBC
• JPA map objects to a database via @Column(length = 2000)
private String description;
• Can access and manipulate relational data from Enterprise Java metadata that can be supplied private String isbn;
Beans (EJBs), web components, and Java SE applications using annotations or in an XML private Integer nbOfPage;
private Boolean illustrations;
descriptor
• Includes an entity manager API to perform DB-related // Constructors, getters, setters
operations like CRUD • Annotations: The code of the }
entity is directly annotated with all
• Includes JPQL, an object-oriented query language sorts of annotations described in
the javax.persistence package.
Wednesday, January 27, 2010 13 Wednesday, January 27, 2010 14
• server-side components
• Singleton: A single session bean is shared between clients and return book;
supports concurrent access }
}