package internal.org.springframework.content.rest.utils;

import org.springframework.data.mapping.PersistentEntity;
import org.springframework.data.mapping.PersistentProperty;
import org.springframework.data.repository.support.Repositories;

import internal.org.springframework.content.rest.controllers.ResourceNotFoundException;

public final class PersistentEntityUtils {

	private PersistentEntityUtils() {}
	
	public static PersistentEntity<?,?> findPersistentEntity(Repositories repositories, 
													  Class<?> domainType) {

		PersistentEntity<?, ?> persistentEntity = repositories.getPersistentEntity(domainType);
		return persistentEntity;
	}
	
	public static PersistentProperty<?> getPersistentProperty(PersistentEntity<?,?> entity, String propertyName) {
		
		PersistentProperty<?> prop = entity.getPersistentProperty(propertyName);
		if (null == prop)
			throw new ResourceNotFoundException();
		
		return prop;
	}
	
	public static boolean isPropertyMultiValued(PersistentProperty<?> prop) {
		return (prop.isArray() || prop.isCollectionLike());
	}
}

@@ -105,831 +105,97 @@
 tent
-Entity;%0Aimport org.springframework.data.mapping.PersistentProperty;%0Aimport org.springframework.data.repository.support.Repositories;%0A%0Aimport internal.org.springframework.content.rest.controllers.ResourceNotFoundException;%0A%0Apublic final class PersistentEntityUtils %7B%0A%0A%09private PersistentEntityUtils() %7B%7D%0A%09%0A%09public static PersistentEntity%3C?,?%3E findPersistentEntity(Repositories repositories, %0A%09%09%09%09%09%09%09%09%09%09%09%09%09  Class%3C?%3E domainType) %7B%0A%0A%09%09PersistentEntity%3C?, ?%3E persistentEntity = repositories.getPersistentEntity(domainType);%0A%09%09return persistentEntity;%0A%09%7D%0A%09%0A%09public static PersistentProperty%3C?%3E getPersistentProperty(PersistentEntity%3C?,?%3E entity, String propertyName) %7B%0A%09%09%0A%09%09PersistentProperty%3C?%3E prop = entity.getPersistentProperty(propertyName);%0A%09%09if (null == prop)%0A%09%09%09throw new ResourceNotFoundException();%0A%09%09%0A%09%09return prop;%0A%09
+Property;%0A%0Apublic final class PersistentEntityUtils %7B%0A%0A%09private PersistentEntityUtils() %7B
 %7D%0A%09%0A

Remove unused persistententity utils code