### Question:
QueryService { public Query createNativeQuery(final String sql) { return entityManager.createNativeQuery(sql); }  Query createQuery(final String qls); Query createQuery(final String qls, final Class<?> clazz); Query createNativeQuery(final String sql); Query createNativeQuery(final String sql, final Class<?> clazz);  }### Answer:
@Test public void createNativeQuery() { assertNotNull(repository.save(EntityUtil.getSamplePermission())); final Query nativeQuery = queryService.createNativeQuery("SELECT * FROM bpermission"); assertNotNull(nativeQuery); final List<?> resultList = nativeQuery.getResultList(); assertNotNull(resultList); assertFalse(resultList.isEmpty()); }
@Test public void createNativeQueryWithResultClass() { BPermission p = repository.save(EntityUtil.getSamplePermission()); assertNotNull(p); final Query nativeQuery = queryService.createNativeQuery("SELECT * FROM bpermission", BPermission.class); assertNotNull(nativeQuery); final List<?> resultList = nativeQuery.getResultList(); assertNotNull(resultList); assertTrue(resultList.contains(p)); }