Java Reference
In-Depth Information
return (CatalogBean)(query.getSingleResult()); }
public java.util.List <CatalogBean> findByJournal
(java.lang.String param1){ Query query= em.createNamedQuery("FindByJo
urnal");
query.setParameter(0, param1 );
return query.getResultList(); }
}
We also need to generate an interface, CatalogFaçade.java , for the session bean
class. The façade interface has the abstract method definitions for the methods
implemented in the session bean façade. The XSLT stylesheet, façade.xslt , used to
generate the session bean interface is listed next:
<?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:variable name="lcletters">
abcdefghijklmnopqrstuvwxyz
</xsl:variable>
<xsl:variable name="ucletters">
ABCDEFGHIJKLMNOPQRSTUVWXYZ
</xsl:variable>
<xsl:template match="entity">
import javax.ejb.Remote;
<xsl:text disable-output-escaping="yes">@</xsl:text>
Remote
<xsl:text> public interface </xsl:text>
<xsl:value-of select="ejb-name" />
Façade{ void create(
<xsl:apply-templates select="cmp-field">
<xsl:with-param name="paramPK" select="'paramPK'" />
<xsl:with-param name="primKeyField" select="primkey-field" />
</xsl:apply-templates>
); void remove(
<xsl:value-of select="ejb-class" />
<xsl:text> </xsl:text>
<xsl:value-of
select="translate((substring(ejb-class,
1,1)),$ucletters,$lcletters)" />
<xsl:value-of select="substring(ejb-class,2)" />
 
Search WWH ::




Custom Search