I have defined custom controllers for my repositories. For example, one looks like this

```
@RequestMapping(method = RequestMethod.GET, value = "/myEntities")
public ResponseEntity<?> get() {
    ...TO SOME STUFF
    MyEntity myEntity= myEntityRepository.findById(1);
    return ResponseEntity.ok(new Resource<>(myEntity));
}

```

This returns a JSON format data which includes a \_links section, where I can get the href to the entity.
Now if I want to return an array of entities which are all resources, I get stuck.

What I have tried so far:

**1.**

```
@RequestMapping(method = RequestMethod.GET, value = "/myEntities")
public ResponseEntity<?> get() {
    ...TO SOME STUFF
    List<MyEntity> myEntityList= myEntityRepository.findAll(1);
    return ResponseEntity.ok(new Resources<>(myEntityList));
} 

```

**2.**

```
@RequestMapping(method = RequestMethod.GET, value = "/myEntities")
public ResponseEntity<?> get() {
    ...TO SOME STUFF
    List<MyEntity> myEntityList= myEntityRepository.findAll();
    List<Resource<MyEntity>> resources = new ArrayList<>();
    myEntityList.forEach(me -> {
        resources.add(new Resource<>(me));
    })
    return ResponseEntity.ok(resources);
} 

```

Option 1. and 2. don't add \_links to the result and I don't understand why. I have googled it a lot and you can add links manually but this seems to be a much clearer way. Can anybody understand, what I'm doing wrong?