Added API methods to query AVM store properties by key pattern.

Cleaned up some warnings in AVMInterpreter.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3765 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Britt Park
2006-09-12 05:43:36 +00:00
parent be6a222554
commit 37b5003ae4
9 changed files with 213 additions and 9 deletions

View File

@@ -69,7 +69,41 @@ class AVMStorePropertyDAOHibernate extends HibernateDaoSupport implements AVMSto
query.setEntity("store", store);
return (List<AVMStoreProperty>)query.list();
}
/**
* Query store properties by key pattern.
* @param store The store.
* @param keyPattern An sql 'like' pattern wrapped up in a QName
* @return A List of matching AVMStoreProperties.
*/
@SuppressWarnings("unchecked")
public List<AVMStoreProperty> queryByKeyPattern(AVMStore store, QName keyPattern)
{
Query query =
getSession().createQuery(
"from AVMStorePropertyImpl asp " +
"where asp.store = :store and asp.name like :name");
query.setEntity("store", store);
query.setParameter("name", keyPattern);
return (List<AVMStoreProperty>)query.list();
}
/**
* Query all stores' properties by key pattern.
* @param keyPattern The sql 'like' pattern wrapped up in a QName
* @return A List of match AVMStoreProperties.
*/
@SuppressWarnings("unchecked")
public List<AVMStoreProperty> queryByKeyPattern(QName keyPattern)
{
Query query =
getSession().createQuery(
"from AVMStorePropertyImpl asp " +
"where asp.name like :name");
query.setParameter("name", keyPattern);
return (List<AVMStoreProperty>)query.list();
}
/**
* Update a modified property.
* @param prop The AVMStoreProperty to update.