2008/6/16 16:02:29 Alex wrote:
> But the actual problem is the element() function: it only allows for
> primary node types in the second argument, not for mixins. So the
> query for the mixin ocm:file2 cannot find any node. See Section
> 6.6.4.13 "element() Node Test" in the JCR spec.
Thany you very much! i have modified the query statememt to:
//[EMAIL PROTECTED]:primaryType = 'ocm:file2']
and it works ok. but i have another question, does jackrabbit not support type
constraint on mixin node types (6.6.3.2 Type Constraint)? Jackrabbit ocm's
query implementation always use element() for type constraint whether the node
type is mixin or not :
//org.apache.jackrabbit.ocm.query.impl.QueryManagerImpl
public String buildJCRExpression(Query query) {
...
String jcrExp = "";
// Add scope & node name
if (((filter.getScope() != null) && (!filter.getScope().equals("")))) {
jcrExp += "/jcr:root" + filter.getScope() + "element(" +
filter.getNodeName() + ", ";
}
else {
jcrExp += "//element(" + filter.getNodeName() + ", ";
}
// Add node type
jcrExp += this.getNodeType(filter) + ") ";
...
}
Best regards
Yonder
___________________________________________________________
雅虎邮箱,您的终生邮箱!
http://cn.mail.yahoo.com/