Design
OTN developers wanted to give FBS users a way to retrieve
forgotten user names and passwords. The FBS stores user account data in the
database, so the developers defined a findByEmail method based
on an EJB QL query. Given an email address, this method returns a UserAccount
object, and the developers wrote code to parse the object and email the user
name and/or password to the user.
This aproach adds the desired functionality to the FBS with
a minimum of effort on the developers' part. The biggest task is to define the
query in ejb-jar.xml. At deployment time, the container (OC4J)
generates the code to implement findByEmail (and the interfaces
that expose it to clients) based on the EJB QL query.
To watch a viewlet that shows how the FBS uses EJB QL, browse
to:
|