public void setRuleForPrincipal(Principal principal, ProfilingRule rule, String locatorName)
{
Transaction tx = persistentStore.getTransaction();
tx.begin();
Filter filter = persistentStore.newFilter();
filter.addEqualTo("principalName", principal);
filter.addEqualTo("locatorName", locatorName);
Object query = persistentStore.newQuery(principalRuleClass, filter);
PrincipalRule pr = (PrincipalRule) persistentStore.getObjectByQuery(query);
if (pr == null)
{
pr = new PrincipalRuleImpl(); // TODO: factory