Escolar Documentos
Profissional Documentos
Cultura Documentos
Holger Klus
Sebastian Herold
tblBill
pk_id fk_consumer dateOfIssue expirationDate balanced
tblConsumer
pk_id firstName lastName email
tblRemoval
pk_id fk_consumer fk_bill fk_drink amount dateOfRemoval
tblDrink tblPrice
pk_id name capacity pk_id fk_drink amount validFrom validUntil
J2EE - Short Overview
Defines queries for the finder and select methods of an entity bean
with container-managed persistence
The scope of an EJB-QL query spans the abstract schemas of
related entity beans that are packaged in the same EJB jar-file.
They are defined in the deployment descriptor of the entity bean
(ejb-jar.xml).
SELECT OBJECT(a) FROM Drink AS a
SELECT DISTINCT OBJECT(p)
FROM Drink d
WHERE d.name = ?1 AND d.capacity = ?2
J2EE – Session Beans
Entity Bean
Entity Bean
EJB-Container
J2EE – Value Objects / Data Access Objects (DAO)
Packaging
All components and deployment descriptors have to be packaged in a
specific way
.ear
- .war
- *.jsp
- WEB-INF
- jboss-web.xml
- web.xml
- .jar
- META-INF
- ejb-jar.xml
- jboss.xml
- jbosscmp-jdbc.xml
- META-INF
- application.xml
J2EE – Deployment and Packaging
Deployment
Step of transferring the J2EE-Application to the application
server
Only the .ear-file has to be deployed
XDoclet-Tags
Java-Files XDoclet-build.xml
ant
Advantages
J2EE provides a complete architecture for developing
- Distributed systems including object persistence, session tracking,
transaction management, …
Separation of technical and application-specific code
- Deployment descriptors
- Container Managed Persistence
Disadvantages
Very complex technology
- Even simple examples require many interfaces, bean classes, deployment
descriptors, …
Many errors occur only at runtime (several steps required until the
application is running)
- Compilation
- Packaging
- Deployment
- Running the application