With Spring CrudRepository Query; I want to select "DeviceType" entities with it's "name" property. But following query select the entitles on case sensitive manner. How I make it case insensitive way. Thanks.
public interface DeviceTypeRepository extends CrudRepository<DeviceType, Integer>, JpaSpecificationExecutor<DeviceType> {
public Iterable<DeviceType> findByNameContaining(String name);
}
Exactly as @Peter mentioned in the comment, just add IgnoreCase
:
public interface DeviceTypeRepository
extends CrudRepository<DeviceType, Integer>, JpaSpecificationExecutor<DeviceType> {
public Iterable<DeviceType> findByNameContainingIgnoreCase(String name);
}
See documentation for a list of all supported keywords inside method names.