Use service inside SDR projection

52 Views Asked by At

I have an entity class Person with uuid column. I have an external rest service(ExternalRestService) where I could fetch information by mentioned uuid column. I want to create projection like

interface PersonWithExternalDataProjection {
 val uuid: UUID,
 val externalData = externalRestService.getDataBy(uuid)
}

Tried @Value but seems it doesn't work.

1

There are 1 best solutions below

0
On

Eventually found that this one works:

@get:Value("#{@externalRestService.getDataBy(target.uuid)}")
val externalData: ExternalData