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

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

class bk
extends ReadOnlyHibernateCallback<ET> {
    final Goid val$goid;
    final HibernateEntityManager this$0;
    private static final String a = bk.a(2, bk.a("W\u0001X{"));

    bk(HibernateEntityManager hibernateEntityManager, Goid goid) {
        this.this$0 = hibernateEntityManager;
        this.val$goid = goid;
    }

    @Override
    public ET doInHibernateReadOnly(Session session) throws HibernateException, SQLException {
        Query query = session.createQuery(this.this$0.c);
        query.setParameter(a, (Object)this.val$goid);
        PersistentEntity persistentEntity = (PersistentEntity)query.uniqueResult();
        this.this$0.initializeLazilyLoaded(persistentEntity);
        return persistentEntity;
    }

    private static char[] a(String string) {
        char[] cArray = string.toCharArray();
        if (cArray.length < 2) {
            cArray = cArray;
            cArray[0] = (char)(cArray[0] ^ 0x41);
        }
        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 -> 50;
                    case 1 -> 108;
                    case 2 -> 51;
                    case 3 -> 29;
                    case 4 -> 103;
                    case 5 -> 28;
                    default -> 65;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

