Java Reference
In-Depth Information
The email attribute uses a custom validation class, dukestutoring.util.Email .
The Person entity has three subclasses, Student , Guardian , and Administrat-
or . For additional data common to all people, the PersonDetails entity is used to
store attributes like pictures and the person's birthday, which aren't included in the Per-
son entity for performance reasons.
The Student entity stores attributes specific to the students who come to tutoring. This
includes information like the student's grade level and school. The Guardian entity's
attributes are specific to the parents or guardians of a Student . Students and guardians
have a many-to-many relationship. That is, a student may have a one or more guardians,
and a guardian may have one or more students. The Administrator entity is for staff
who manage the tutoring center.
The Address entity represents a mailing address, and is associated with Person entit-
ies. Addresses and people have a many-to-one relationship. That is, one person may have
many addresses.
The TutoringSession entity represents a particular day at the tutoring center. A par-
ticular tutoring session tracks which students attended that day, and which students went
to the park. Associated with TutoringSession is the StatusEntry entity, which
logs when a student's status changes. Students' status changes when they check in to a tu-
toring session, when they go to the park, and when they check out. The status entry allows
the tutoring center staff to track exactly which students attended a tutoring session, when
they checked in and out, which students went to the park while they were at the tutoring
center, and when they went to and came back from the park.
For information on creating Java Persistence API entities, see Chapter 19 , “Introduction
to the Java Persistence API,” in The Java EE 6 Tutorial: Basic Concepts . For information
on validating entity data, see“Validating Persistent Fields and Properties” in The Java EE
6 Tutorial: Basic Concepts and Chapter 22 , Bean Validation: Advanced Topics .
Enterprise Beans Used in the Main Interface
The enterprise beans used in the main interface provide the business logic for Duke's
Tutoring, and are located in the dukestutoring.ejb package in the dukes-
tutoring-war project.
ConfigBean is singleton session bean used to create the default students, guardians, and
administrator when the application is initially deployed, and to create an automatic EJB
timer that creates tutoring session entities every weekday.
RequestBean is a stateless session bean containing the business methods for the main
interface. Students or staff can check students in and out and track when they go to and
Search WWH ::




Custom Search