title: java.lang.IllegalArgumentException: Failed to create query method in a JpaRepository
body: <p>I use the technologies jpa, hibernate, spring boot - data, api REST. </p>
  
  <p>I have the following error: </p>
  
  <blockquote>
    <p>org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'walletRestService': Unsatisfied dependency expressed through field 'walletRepository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'walletRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Failed to create query method public abstract java.lang.Long com.wj.dao.WalletRepository.createWallet(java.lang.Long,java.lang.String)! No property createWallet found for type Wallet!</p>
  </blockquote>
  
  <p>Here is my code :</p>
  
  <p>Entity user: </p>
  
  <pre><code>package com.wj.entities;
  import java.io.Serializable;
  import java.util.ArrayList;
  import java.util.List;
  
  import javax.persistence.Entity;
  import javax.persistence.FetchType;
  import javax.persistence.GeneratedValue;
  import javax.persistence.Id;
  import javax.persistence.OneToMany;
  
  import com.fasterxml.jackson.annotation.JsonManagedReference;
  
  @Entity
  public class User implements Serializable{
  
  @Id
  @GeneratedValue
  private Long id; 
  private String name;
  
  @OneToMany(mappedBy="user", fetch=FetchType.LAZY)
  @JsonManagedReference
  private List&lt;Wallet&gt; wallets = new ArrayList&lt;&gt;();
  
  public User() {
      super();
  }
  
  public User(String name) {
      super();
      this.name = name;
  }
  
  
  
  public User(Long id, String name) {
      super();
      this.id = id;
      this.name = name;
  }
  
  
  
  public User(Long id, String name, List&lt;Wallet&gt; wallets) {
      super();
      this.id = id;
      this.name = name;
      this.wallets = wallets;
  }
  
  public Long getId() {
      return id;
  }
  
  public void setId(Long id) {
      this.id = id;
  }
  
  public String getName() {
      return name;
  }
  
  public void setName(String name) {
      this.name = name;
  }
  
  public List&lt;Wallet&gt; getWallets() {
      return wallets;
  }
  
  public void setWallets(List&lt;Wallet&gt; wallets) {
      this.wallets = wallets;
  }
  
  
  }
  </code></pre>
  
  <p>Entity wallet: </p>
  
  <pre><code>@Id
  @GeneratedValue
  private Long id;
  private String name;
  @ManyToOne
  @JoinColumn(name="user_id")
  @JsonBackReference    
  private User user;
  
  public Wallet() {
      super();
  }
  
  
  
  
  public Wallet(String name, User user) {
      super();
      this.name = name;
      this.user = user;
  }
  
  
  
  
  public Wallet(Long id, String name, User user) {
      super();
      this.id = id;
      this.name = name;
      this.user = user;
  }
  
  
  
  public Long getId() {
      return id;
  }
  
  public void setId(Long id) {
      this.id = id;
  }
  
  public String getName() {
      return name;
  }
  
  public void setName(String name) {
      this.name = name;
  }
  
  public User getUser() {
      return user;
  }
  
  public void setUser(User user) {
      this.user = user;
  }
  
  
  }
  </code></pre>
  
  <p>restApi: </p>
  
  <pre><code>@RequestMapping(value="/wallets", method=RequestMethod.POST)
  public Wallet save(@RequestBody Wallet wallet) {
      User user = wallet.getUser();
  
      Long id = walletRepository.createWallet(user.getId(), wallet.getName());
      User boundUser = wallet.getUser();
      User simpleUser = new User(boundUser.getId(), boundUser.getName());
      wallet = new Wallet(id, wallet.getName(), simpleUser);
      return walletRepository.save(wallet);
  }
  
  DAO:  
  
  package com.wj.dao;
  import org.springframework.data.jpa.repository.JpaRepository;
  import com.wj.entities.Wallet;
  
  public interface WalletRepository extends JpaRepository&lt;Wallet, Long&gt;{
     Long createWallet(Long id, String name);
  }
  </code></pre>