All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.formkiq.server.dao.ClientDaoImpl Maven / Gradle / Ivy

There is a newer version: 0.6.1
Show newest version
package com.formkiq.server.dao;

import org.hibernate.Session;
import org.hibernate.type.IntegerType;
import org.springframework.stereotype.Repository;

/**
 * Implementation of the Client Dao.
 *
 */
@Repository
public class ClientDaoImpl extends AbstractDaoImpl implements ClientDao {

    @Override
    public int clientCount() {
        String sql = "select count(*) as count from oauth_client_details";
        Session session = getEntityManager().unwrap(Session.class);

        Integer count = (Integer) session.createSQLQuery(sql)
                .addScalar("count", IntegerType.INSTANCE)
                .uniqueResult();
        return count.intValue();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy