mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Added DAOs. Attribute query objects seem to be able to generate hibernate predicates.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5467 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -25,8 +25,6 @@
|
||||
|
||||
package org.alfresco.service.cmr.attributes;
|
||||
|
||||
import org.alfresco.repo.attributes.Attribute;
|
||||
import org.alfresco.repo.attributes.AttributeUnsupportedQueryType;
|
||||
|
||||
/**
|
||||
* A "like" query.
|
||||
@@ -37,23 +35,21 @@ public class AttrQueryLike extends AttrQuery
|
||||
private static final long serialVersionUID = -984397014171296687L;
|
||||
|
||||
/**
|
||||
* @param value
|
||||
* @param name
|
||||
*/
|
||||
public AttrQueryLike(Attribute value)
|
||||
public AttrQueryLike(String name)
|
||||
{
|
||||
super(value);
|
||||
super(name);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.attributes.AttrQuery#getPredicate()
|
||||
*/
|
||||
@Override
|
||||
public String getPredicate()
|
||||
public String getPredicate(AttrQueryHelper helper)
|
||||
{
|
||||
if (fValue.getType() != Attribute.Type.STRING)
|
||||
{
|
||||
throw new AttributeUnsupportedQueryType(fValue.getType().name());
|
||||
}
|
||||
return "ent." + fAttrName + " like " + getValue();
|
||||
String name = ":name" + helper.getNextSuffix();
|
||||
helper.setParameter(name, fValue);
|
||||
return "me.key like " + name;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user