Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exclude values in the controller #48

Open
maroom1 opened this issue Jul 19, 2017 · 0 comments
Open

exclude values in the controller #48

maroom1 opened this issue Jul 19, 2017 · 0 comments

Comments

@maroom1
Copy link

maroom1 commented Jul 19, 2017

I cam here after seeing your post in stackoverflow, which impressed and solving my problem.

I am new to spring boot and its implementation

Coming to problem : I have to model classes songs , movies

where movie id belong to song class and I joined this table with movies

In the controller how to implement to exclude all the fields of the movie except id and name .

My controller class is

@RestController
@RequestMapping("api")
public class SongsController {

@Autowired
SongsRepository songsRepository;

    @RequestMapping(value = "/Songs", method = RequestMethod.GET)
    public ResponseEntity<List<Songs>> getSongsList(){

      
        return new ResponseEntity<>(songsRepository.findAll(), HttpStatus.OK);}


songs class has (id , movieid, songtitile.....)
movie class has (movieid, moviename, ..........................)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant