private List<String> dependenciesOf(Package source) { List<String> result = new ArrayList<>(); if (source.isAnnotationPresent(DependsUpon.class)) for (Class<?> target : source.getAnnotation(DependsUpon.class).packagesOf()) result.add(target.getPackage().getName()); return result; }
/** @see DATAJPA-472 */ @Test public void shouldSupportFindAllWithPageableAndEntityWithIdClass() throws Exception { if (Package.getPackage("org.hibernate.cfg").getImplementationVersion().startsWith("4.1.")) { // we expect this test to fail on 4.1.x - due to a bug in hibernate - remove as soon as 4.1.x // fixes the issue. expectedException.expect(InvalidDataAccessApiUsageException.class); expectedException.expectMessage("No supertype found"); } IdClassExampleDepartment dep = new IdClassExampleDepartment(); dep.setName("TestDepartment"); dep.setDepartmentId(-1); IdClassExampleEmployee emp = new IdClassExampleEmployee(); emp.setDepartment(dep); emp = employeeRepositoryWithIdClass.save(emp); Page<IdClassExampleEmployee> page = employeeRepositoryWithIdClass.findAll(new PageRequest(0, 10)); assertThat(page, is(notNullValue())); assertThat(page.getTotalElements(), is(1L)); }