Java Reference
In-Depth Information
return query.getResultList();
}
In the findByJournal() method, a query object is obtained from the named query
and a java.util.List of entity beans is obtained with the getResultList()
method of the query object.
The XSLT stylesheet
The XSL stylesheet ( façade-bean.xsl ) used to generate the session bean façade
class is listed below.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/
Transform">
<xsl:output encoding="ISO-8859-1" omit-xml-declaration="yes"
method="text"/>
<xsl:template match="/">
<xsl:apply-templates select="ejb-jar/enterprise-beans/entity"/>
</xsl:template>
<xsl:template match="package">
package
<xsl:value-of select="."/>;
</xsl:template>
<xsl:variable name="lcletters">abcdefghijklmnopqrstuvwxyz</
xsl:variable>
<xsl:variable name="ucletters">ABCDEFGHIJKLMNOPQRSTUVWXYZ</
xsl:variable>
<xsl:template match="entity">
Add the import statements:
import javax.persistence.EntityManager; import javax.persistence.
Query; import
javax.annotation.Resource; import javax.ejb.Stateless;
Add the annotation to specify a Stateless bean:
<xsl:text disable-output-escaping="yes">@</xsl:text>
Stateless
Add the session bean class declaration:
<xsl:text> public class </xsl:text>
<xsl:value-of select="ejb-name"/>
FaçadeBean implements
<xsl:value-of select="ejb-name"/>
 
Search WWH ::




Custom Search