package com.l7tech.server.security.keystore;

import com.l7tech.objectmodel.Goid;
import com.l7tech.objectmodel.UpdateException;
import com.l7tech.util.Functions.UnaryVoid;
import org.hibernate.HibernateException;
import org.hibernate.LockMode;
import org.hibernate.Session;
import org.springframework.orm.hibernate5.HibernateCallback;

class e implements HibernateCallback<KeystoreFile> {
   final Goid val$id;
   final UnaryVoid val$mutator;
   final KeystoreFileManagerImpl this$0;

   e(KeystoreFileManagerImpl var1, Goid var2, UnaryVoid var3) {
      this.this$0 = var1;
      this.val$id = var2;
      this.val$mutator = var3;
   }

   public KeystoreFile doInHibernate(Session var1) throws HibernateException {
      try {
         KeystoreFile var2 = (KeystoreFile)var1.load(KeystoreFile.class, this.val$id, LockMode.UPGRADE);
         this.val$mutator.call(var2);
         this.this$0.update(var2);
         return var2;
      } catch (UpdateException var3) {
         throw new HibernateException(var3);
      }
   }
}
