/* (non-Javadoc)
  * @see org.mitre.uma.repository.PermissionRepository#getByTicket(java.lang.String)
  */
 @Override
 public PermissionTicket getByTicket(String ticket) {
   TypedQuery<PermissionTicket> query =
       em.createNamedQuery(PermissionTicket.QUERY_TICKET, PermissionTicket.class);
   query.setParameter(PermissionTicket.PARAM_TICKET, ticket);
   return JpaUtil.getSingleResult(query.getResultList());
 }
 @Override
 public AuthenticationHolderEntity getByAuthentication(OAuth2Authentication a) {
   TypedQuery<AuthenticationHolderEntity> query =
       manager.createNamedQuery(
           "AuthenticationHolderEntity.getByAuthentication", AuthenticationHolderEntity.class);
   query.setParameter("authentication", a);
   return JpaUtil.getSingleResult(query.getResultList());
 }
 /* (non-Javadoc)
  * @see org.mitre.uma.repository.PermissionRepository#saveRawPermission(org.mitre.uma.model.Permission)
  */
 @Override
 @Transactional(value = "defaultTransactionManager")
 public Permission saveRawPermission(Permission p) {
   return JpaUtil.saveOrUpdate(p.getId(), em, p);
 }
 @Override
 @Transactional
 public AuthenticationHolderEntity save(AuthenticationHolderEntity a) {
   return JpaUtil.saveOrUpdate(a.getId(), manager, a);
 }