UserroleDaoImpl extends WaspDaoImpl<Userrole> implements edu.yu.einstein.wasp.dao.UserroleDao { @Override @Transactional("entityManager") public Userrole getUserroleByUserroleId (final int userroleId) { HashMap<String, Integer> m = new HashMap<String, Integer>(); m.put("id", userroleId); List<Userrole> results = this.findByMap(m); if (results.size() == 0) { Userrole rt = new Userrole(); return rt; } return results.get(0); } UserroleDaoImpl(); @Override @Transactional("entityManager") Userrole getUserroleByUserroleId(final int userroleId); @Override @Transactional("entityManager") Userrole getUserroleByUserIdRoleId(final int userId, final int roleId);  }
@Test (groups = "db-tests") public void testGetUserroleByUserroleId() { HashMap m = new HashMap(); m.put("id", 1); List<Userrole> results = userroleDao.findByMap(m); Userrole actual = results.get(0); Role role = actual.getRole(); ReflectionAssert.assertLenientEquals("rolename","su", role.getRoleName()); }