JPA annotation @Autowired

0

Is @Autowired the same as extends?

Let's look at a small example:

package com.dendetech.services;

import com.dendetech.entity.Participante; import com.dendetech.repositories.PartnerRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service;

@Service public class ParticipantService {

@Autowired
private ParticipanteRepository participanteRepository;

/*
 * Crud Operations
 */

asked by anonymous 08.09.2015 / 15:37

1 answer

1

No, every thing is one thing.

This annotation is automatically injecting an instance of ParticipanteRepository .

So you do not have to use new ParticipanteRepository() or any other creative method at all.

Extends is Inheritance, in this case the Service would inherit from the Repository.

    
08.09.2015 / 15:43