You can simply add GROUP BY instead of Distinct
@Query(value = "from someTableEntity where entityCode in :entityCode" +
" group by entityCode, entityName, entityType")
List<someTableEntity > findNameByCode(@Param("entityCode") List<String> entityCode);