com.formkiq.server.dao.ClientDaoImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of formkiq-server Show documentation
Show all versions of formkiq-server Show documentation
Server-side integration for the FormKiQ ios application
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();
}
}