roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Johnson (JIRA)" <>
Subject [jira] Commented: (ROL-1755) Tag intersection not an intersection
Date Fri, 19 Dec 2008 17:57:20 GMT


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 ");
            for(int i = 0; i < tags.size(); i++) {
                if (i != 0) queryString.append(" OR ");
                params.add(size++, tags.get(i));
                queryString.append(" = ?").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:
>             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.

View raw message