You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by "David Johnson (JIRA)" <ji...@apache.org> on 2008/12/19 18:57:20 UTC
[jira] Commented: (ROL-1755) Tag intersection not an intersection
[ https://issues.apache.org/roller/browse/ROL-1755?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14478#action_14478 ]
David Johnson commented on ROL-1755:
------------------------------------
Unfortunately this problem is not as simple as changing OR to AND.
Here's code the "new" JPA implementation that adds the tags clause to the weblog entry query.
if (tags == null || tags.size()==0) {
queryString.append("SELECT e FROM WeblogEntry e WHERE ");
} else {
queryString.append("SELECT e FROM WeblogEntry e JOIN e.tags t WHERE ");
queryString.append("(");
for(int i = 0; i < tags.size(); i++) {
if (i != 0) queryString.append(" OR ");
params.add(size++, tags.get(i));
queryString.append(" t.name = ?").append(size);
}
queryString.append(") AND ");
}
Changing the OR an an AND causes the query to return no results.
I don't see any way to fix this problem without using sub-query and those are not supported in OpenJPA 0.9.7 which is the persistence engine in Roller 4.0.
This problem should be revisited once we switch to OpenJPA 1.x or better.
> Tag intersection not an intersection
> ------------------------------------
>
> Key: ROL-1755
> URL: https://issues.apache.org/roller/browse/ROL-1755
> Project: Roller
> Issue Type: Bug
> Components: JPA Backend
> Reporter: David Johnson
> Assignee: David Johnson
> Priority: Minor
> Fix For: 4.0.1
>
>
> Links like this http://host/blogname/tags/history+hypertext should give the intersection of the two tags history and hypertext, not the union. This is a regression caused by a bug in the JPA implementation used in 4.0.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.