spring data jpa inheritance repository

Java
@NoRepositoryBean
public interface AbstractRepository<T extends AbstractEquipment> 
        extends CrudRepository<T, Long>{

 @Query("select e from #{#entityName} as e from equipment where e.name = equipmentName")
 T findEquipmentByName(String equipmentName);

}@Transactional
public interface SpecialEquipmentRepo extends AbstractRepository<SpecialEquipment,Long>{

}
Source

Also in Java: