jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gerald Reinhart (JIRA)" <j...@apache.org>
Subject [jira] Created: (JCR-1973) OCM search features should retrieve objects also from VersionHistory objects
Date Tue, 10 Feb 2009 13:53:06 GMT
OCM search features should retrieve objects also from VersionHistory objects
----------------------------------------------------------------------------

                 Key: JCR-1973
                 URL: https://issues.apache.org/jira/browse/JCR-1973
             Project: Jackrabbit Content Repository
          Issue Type: Improvement
          Components: jackrabbit-ocm
    Affects Versions: 1.5.2
            Reporter: Gerald Reinhart
            Priority: Minor



@Node(jcrMixinTypes = "mix:versionable")
public class MyObject {
    private String path;
    private String foo;
    // other attributes, getters and setters follows ...
}

-check in many versions of this object differing for the value
of "foo" attribute (ie: "bar", "dummy", "lazy", etc...) 
-retrieve one of them searching for it's "foo" value.
Example:

MyObject myobject = new MyObject();
myobject.setPath("/itsme");
myobject.setFoo("bar");
ocm.insert(myobject);
...
myobject.setFoo("dummy");
ocm.checkout("/itsme");
ocm.update(myobject);
ocm.checkin(myobject);
...
myobject.setFoo("lazy");
ocm.checkout("/itsme");
ocm.update(myobject);
ocm.checkin(myobject);
...

Filter f1 = qm.createFilter(MyObject.class);
f1.addEqualTo("foo", "lazy");
MyObject o = (MyObject) ocm.getObject(qm.createQuery(f1)); // This works!
...
Filter f2 = qm.createFilter(MyObject.class);
f2.addEqualTo("foo", "bar");
MyObject o = (MyObject) ocm.getObject(qm.createQuery(f2)); // This
returns "null" 
...


The Query do not scan different versions of the object MyObject.

See original discussion : http://www.nabble.com/OCM%2C-queries-and-version-history-tt21459838.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message