Author: dan.j.allen
Date: 2009-04-07 18:31:57 -0400 (Tue, 07 Apr 2009)
New Revision: 10340
Modified:
trunk/seam-gen/src/Query.java
Log:
switch to using constructor to prepare Query
Modified: trunk/seam-gen/src/Query.java
===================================================================
--- trunk/seam-gen/src/Query.java 2009-04-07 21:22:43 UTC (rev 10339)
+++ trunk/seam-gen/src/Query.java 2009-04-07 22:31:57 UTC (rev 10340)
@@ -1,16 +1,22 @@
package @actionPackage@;
+import @modelPackage@.@entityName@;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.web.RequestParameter;
import org.jboss.seam.framework.EntityQuery;
+import java.util.Arrays;
@Name("@componentName@")
-public class @beanName@ extends EntityQuery
+public class @beanName@ extends EntityQuery<@entityName@>
{
- @Override
- public String getEjbql()
+ private static final String EJBQL = "@query@";
+ private static final String[] RESTRICTIONS = {};
+
+ public @beanName@()
{
- return "@query@";
+ setEjbql(EJBQL);
+ setRestrictionExpressionStrings(Arrays.asList(RESTRICTIONS));
+ setMaxResults(25);
}
@RequestParameter
@@ -18,10 +24,4 @@
public void setFirstResult(Integer firstResult) {
super.setFirstResult(firstResult);
}
-
- @Override
- public Integer getMaxResults() {
- return 25;
- }
-
}
Show replies by date