Open
Description
Hayk Avetisyan opened DATACMNS-1761 and commented
Given the following example entity:
@Entity
public class CountryNode {
@Id
@GeneratedValue(generator = "uuid2")
@GenericGenerator(name = "uuid2", strategy = "uuid2")
private UUID id;
@OneToOne
@JoinColumn(name = "country_id")
private Country country;
}
@Entity public class Country {
private String iso2;
}
When I create a Jpa Repository Function to find all entities by a property of the relation:
@Repository
public interface CountryNodeRepository extends JpaRepository<CountryNode, UUID> {
List<CountryNode> findAllByCountryIso2(String countryIso2);
}
Then it doesn't work
(if it was findAllByCountryIno2
, it would work)
—
It works for findAllByCountry_Iso2(String countryIso2)
. But this is not the desired way for cases where there is, for instance, a SonarQube rule that does not allow/recommend to use underscores in function names.
No further details from DATACMNS-1761