class HibernateDashletDAO extends HibernatePersistentObjectDAO<Dashlet> implements DashletDAO {

	@Override
	public Dashlet findByName(String name, long tenantId) {
		List<Dashlet> dashlets = new ArrayList<Dashlet>();
		try {
			dashlets = findByWhere("_entity.tenantId = ?1 and _entity.name = ?2", new Object[] { tenantId, name }, null,
					null);
		} catch (PersistenceException e) {
			log.error(e.getMessage(), e);
		}
		return dashlets != null && dashlets.size() > 0 ? dashlets.get(0) : null;

	}

	protected  HibernateDashletDAO();

}