[jbossseam-issues] [JBoss JIRA] Closed: (JBSEAM-1290) EntityQuery.refresh() does not clear parsedEjbql variable
Gavin King (JIRA)
jira-events at lists.jboss.org
Sat May 19 01:43:52 EDT 2007
[ http://jira.jboss.com/jira/browse/JBSEAM-1290?page=all ]
Gavin King closed JBSEAM-1290.
------------------------------
Fix Version/s: 1.3.0.BETA1
Resolution: Done
Assignee: Gavin King
Done in CVS, please test.
> EntityQuery.refresh() does not clear parsedEjbql variable
> ---------------------------------------------------------
>
> Key: JBSEAM-1290
> URL: http://jira.jboss.com/jira/browse/JBSEAM-1290
> Project: JBoss Seam
> Issue Type: Feature Request
> Components: Framework
> Affects Versions: 1.2.1.GA
> Environment: Windows XP/JBoss4.0.5GA/JDK1.6
> Reporter: Milli Coelho
> Assigned To: Gavin King
> Priority: Minor
> Fix For: 1.3.0.BETA1
>
>
> I'm using the seam-gen generated class SubcategoriesList which is derived from EntityQuery and modified it to accept any query passed by a calling object as below:
> public class SubCategoriesList extends EntityQuery {
> private SubCategories subCategories = new SubCategories();
> private String query;
> private Integer maxResults;
>
> public SubCategoriesList()
> {
> query = "select subCategories from SubCategories subCategories";
> this.maxResults = 25;
> }
>
> @Override
> public String getEjbql() {
> return query;
> }
> @Override
> public Integer getMaxResults() {
> return this.maxResults;
> }
> public SubCategories getSubCategories() {
> return subCategories;
> }
> @Override
> public List<String> getRestrictions() {
> return Arrays.asList(RESTRICTIONS);
> }
> public List<SubCategories> forCategory(String categoryId)
> {
> query = "select subCategories from SubCategories subCategories where subCategories.categories.id = " + Integer.parseInt(categoryId);
> return getResultList();
> }
>
> }
> In my calling object, I instantiate this class and use the method forCategory to get the list of subcategories for a given category id. If I reuse the object after calling refresh() and pass a different category id, it gives the same resultlist. After looking in EntityQuery and Query classes, I see refresh() does not nullify parsedEjbql and therefore createQuery() uses the same query everytime to get the resultlist.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the seam-issues
mailing list