No Valid ejbCreate% Definitions in Session-Beans |
This query determines all the stateful session-beans that do not define a valid ejbCreate% method.
Pre-packaged Query
Query name="Semmle/StyleChecks/J2EE/Session-Bean/Stateful Session-Bean/A session-bean must have a valid ejbCreate%(..) method definition"
Reports all stateful Session-Bean types that do not contain one or more ejbCreate%(..) methods that are public, not final and not static and have return type void.
from SessionBean sbean
where not exists(Method m | m.getName().matches("ejbCreate%") and sbean.inherits(m) and m.hasModifier("public") and not(m.hasModifier("final")) and not(m.hasModifier("static")) and m.getType().hasName("void"))
select sbean, sbean.toString() + " session-bean must define an ejbCreate%(..)"
+ " method that is public, not final, not static and"
+ " has return type void"
References
Enterprise JavaBeans 2.1 - Specification, section 7.11.3
|