class HibernateUserDAO extends HibernatePersistentObjectDAO<User> implements UserDAO {

	@Override
	public int count(Long tenantId) {
		String query = "select count(*) from ld_user where ld_type=" + User.TYPE_DEFAULT + " and not(ld_deleted=1) "
				+ (tenantId != null ? " and ld_tenantid=" + tenantId : "");

		try {
			return queryForInt(query);
		} catch (PersistenceException e) {
			log.error(e.getMessage(), e);
			return 0;
		}
	}

	private  HibernateUserDAO();

}