@Test(enabled = false) public void testPerformance() throws Exception { for (int i = 0; i < 100000; i++) { StopWatch stopWatch = new StopWatch(); stopWatch.start(); this.resourceRepository.save(new ResourceEntity(TEST_ZONE_1, String.format("/x-files/%d", i))); this.resourceRepository.getByZoneAndResourceIdentifier(TEST_ZONE_1, String.format("/x-files/%d", i)); stopWatch.stop(); System.out.println(String.format("Test %d took: %d ms", i, stopWatch.getTime())); Thread.sleep(1L); } }
@Override public ResourceEntity getByZoneAndResourceIdentifier(final ZoneEntity zone, final String resourceIdentifier) { return getEntity(zone, resourceIdentifier); }
GraphResourceRepository extends GraphGenericRepository<ResourceEntity> implements ResourceRepository, ResourceHierarchicalRepository { @Override public ResourceEntity getByZoneAndResourceIdentifier(final ZoneEntity zone, final String resourceIdentifier) { return getEntity(zone, resourceIdentifier); } }
GraphResourceRepository extends GraphGenericRepository<ResourceEntity> implements ResourceRepository, ResourceHierarchicalRepository { @Override public ResourceEntity getByZoneAndResourceIdentifier(final ZoneEntity zone, final String resourceIdentifier) { return getEntity(zone, resourceIdentifier); }  }
GraphResourceRepository extends GraphGenericRepository<ResourceEntity> implements ResourceRepository, ResourceHierarchicalRepository { @Override public ResourceEntity getByZoneAndResourceIdentifier(final ZoneEntity zone, final String resourceIdentifier) { return getEntity(zone, resourceIdentifier); }  @Override ResourceEntity getByZoneAndResourceIdentifier(final ZoneEntity zone, final String resourceIdentifier); @Override ResourceEntity getResourceWithInheritedAttributes(final ZoneEntity zone, final String resourceIdentifier); @Override Set<String> getResourceEntityAndDescendantsIds(final ResourceEntity entity); @Override List<S> findAll(final Example<S> example); @Override List<S> findAll(final Example<S> example, final Sort sort); @Override S findOne(final Example<S> example); @Override Page<S> findAll(final Example<S> example, final Pageable pageable); @Override long count(final Example<S> example); @Override boolean exists(final Example<S> example); }
GraphResourceRepository extends GraphGenericRepository<ResourceEntity> implements ResourceRepository, ResourceHierarchicalRepository { @Override public ResourceEntity getByZoneAndResourceIdentifier(final ZoneEntity zone, final String resourceIdentifier) { return getEntity(zone, resourceIdentifier); }  @Override ResourceEntity getByZoneAndResourceIdentifier(final ZoneEntity zone, final String resourceIdentifier); @Override ResourceEntity getResourceWithInheritedAttributes(final ZoneEntity zone, final String resourceIdentifier); @Override Set<String> getResourceEntityAndDescendantsIds(final ResourceEntity entity); @Override List<S> findAll(final Example<S> example); @Override List<S> findAll(final Example<S> example, final Sort sort); @Override S findOne(final Example<S> example); @Override Page<S> findAll(final Example<S> example, final Pageable pageable); @Override long count(final Example<S> example); @Override boolean exists(final Example<S> example); static final String RESOURCE_LABEL; static final String RESOURCE_ID_KEY; }