/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.objectmodel.Goid
 *  org.hibernate.HibernateException
 *  org.hibernate.Session
 *  org.hibernate.query.Query
 */
package com.l7tech.server.entity;

import com.l7tech.objectmodel.Goid;
import com.l7tech.server.entity.GenericEntityManagerImpl;
import com.l7tech.server.util.ReadOnlyHibernateCallback;
import java.sql.SQLException;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.query.Query;

class i
extends ReadOnlyHibernateCallback<Integer> {
    final Goid val$goid;
    final Class val$entityClass;
    final GenericEntityManagerImpl this$0;
    private static final String[] a;

    i(GenericEntityManagerImpl genericEntityManagerImpl, Goid goid, Class clazz) {
        this.this$0 = genericEntityManagerImpl;
        this.val$goid = goid;
        this.val$entityClass = clazz;
    }

    @Override
    public Integer doInHibernateReadOnly(Session session) throws HibernateException, SQLException {
        Query query = session.createQuery(this.this$0.o);
        String[] stringArray = a;
        query.setParameter(stringArray[1], (Object)this.val$goid);
        query.setParameter(stringArray[0], (Object)this.val$entityClass.getName());
        return (Integer)query.uniqueResult();
    }

    /*
     * Enabled aggressive block sorting
     */
    static {
        String[] stringArray = new String[2];
        int n2 = 0;
        String string = "\u000b\u001d\nF;l,\u0002\u0012\r\\\u0001t\u0002\u000b\u0004\t\u001c\u0017K";
        int n3 = "\u000b\u001d\nF;l,\u0002\u0012\r\\\u0001t\u0002\u000b\u0004\t\u001c\u0017K".length();
        int n4 = 15;
        int n5 = -1;
        while (true) {
            int n6 = ++n5;
            stringArray[n2++] = i.a(70, i.a(string.substring(n6, n6 + n4)));
            if ((n5 += n4) >= n3) {
                a = stringArray;
                return;
            }
            n4 = string.charAt(n5);
        }
    }

    private static char[] a(String string) {
        char[] cArray = string.toCharArray();
        if (cArray.length < 2) {
            cArray = cArray;
            cArray[0] = (char)(cArray[0] ^ 0x29);
        }
        return cArray;
    }

    /*
     * Handled impossible loop by duplicating code
     * Enabled aggressive block sorting
     */
    private static String a(int n2, char[] cArray) {
        char[] cArray2;
        block11: {
            int n3;
            int n4;
            int n5;
            block10: {
                n5 = n2;
                cArray2 = cArray;
                n4 = cArray.length;
                n3 = 0;
                if (!true) break block10;
                n4 = n4;
                if (n4 <= n3) break block11;
            }
            do {
                n5 = n5;
                cArray2 = cArray2;
                int n6 = n3;
                cArray2[n6] = (char)(cArray2[n6] ^ (n5 ^ (switch (n3 % 7) {
                    case 0 -> 40;
                    case 1 -> 53;
                    case 2 -> 56;
                    case 3 -> 105;
                    case 4 -> 9;
                    case 5 -> 83;
                    default -> 41;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

