Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
None
-
None
-
None
Description
@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