Entity-Beans with no Valid Constructor |
The aim of this query is to point out violations of the following rule: an entity-bean class must define a public constructor that takes no arguments.
Pre-packaged Query
Query name="Semmle/StyleChecks/J2EE/Entity-Bean/An entity-bean class must define a public constructor that takes no arguments"
Reports all Entity-Bean types that do not contain a public constructor that takes no arguments.
from EntityBean ebean
where not exists(Constructor c | c.getDeclaringType() = ebean and c.hasModifier("public") and c.hasNoParams())
select ebean, ebean.toString() + " entity-bean class must define"
+ " a public constructor that takes no arguments"
References
Enterprise JavaBeans 2.1 - Specification, section 10.6.2 and 12.2.2
|