How to handle underscores in the column name of Apache Ignite Cache/Tables

Viewed 55

My Ignite Cache "Person" is having fields as id,name,city_id

So my POJO class is like

private String id;
private String name;
private String city_id;

But in the IgniteRepository, When I am trying to write Query method as findByCityId() or findByCity_Id() or findByCity__id(), nothing works for me.

Is there a way to handle this or Only option is to use SQL query in the Repository @Query?

In normal MySql and Spring data, we used to add Column Name to change the column name as per our choice, so similarly what can be done here ?

1 Answers

Use QuerySqlField annotation to customize POCO mapping.

@QuerySqlField(name = "CityId")
private String city_id;
Related