Created
April 16, 2022 14:35
-
-
Save AnanthaRajuC/ef698414a98b328a9450bc29fb89da0a to your computer and use it in GitHub Desktop.
Projections for Spring Data REST
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.github.anantharajuc.springdatarest.model.projection; | |
import io.github.anantharajuc.springdatarest.model.Person; | |
import org.springframework.beans.factory.annotation.Value; | |
import org.springframework.data.rest.core.config.Projection; | |
@Projection(name="idAndFullName", types={Person.class}) | |
public interface IdAndFullName { | |
Long getId(); | |
@Value("#{target.firstName}"+" "+"#{target.lastName}") | |
String getFullName(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment