Isn't a better way just to add a new annotation?

Like RepositoryConfig but from v2 package for example.

This case whose who already use it won't suffer.

Also it's would be great to provide a way to escape constants which are
similar to spel expressions.

Regards,
Igor

чт, 30 янв. 2020 г., 13:18 Sergey Chernolyas <sergey.chernol...@gmail.com>:

> Hi igniters!
>
> Presently, Spring Data for Ignite can't be configured dynamically. I mean ,
> than I defines repository by the code:
>
> @Repository
> @RepositoryConfig(cacheName = "Calendar")
> public interface CalendarRepository extends IgniteRepository<Calendar,
> String> {
>     List<Calendar> findByName(String name);
> }
>
> But I need to configure used cache dynamically ( at runtime). To solve
> this problem is proposed to use Spring Expression Language. By the
> way, I will have possibility to use the code:
>
> @Repository
> @RepositoryConfig(cacheName = "${cache.calendar.name}")
> public interface CalendarRepository extends IgniteRepository<Calendar,
> String> {
>     List<Calendar> findByName(String name);
> }
>
> And property "cache.calendar.name" can be configured as usual property
> at Spring Framework.
>
> But way brakes current configuration way and I would ask about how we
> can set cache name by  expression or constant string.
>
> I see options:
>
> 1) field "cacheName" will be able to process expression and constant
> string. The code of repository factory will analyse the field.
>
> 2) create new field for expressions
>
>
> What is best way?
>
>
> --
> ---------------------
>
> With best regards, Sergey Chernolyas
>

Reply via email to