我使用 jpa、hibernate、spring boot - data、api REST 技术。
我有以下错误:
org.springframework.beans.factory.UnsatisfiedDependencyException:创建名为“walletRestService”的bean时出错:通过字段“walletRepository”表达的不满意依赖;嵌套异常是 org.springframework.beans.factory.BeanCreationException:创建名为“walletRepository”的 bean 时出错:调用 init 方法失败;嵌套异常是 java.lang.IllegalArgumentException: Failed to create query method public abstract java.lang.Long com.wj.dao.WalletRepository.createWallet(java.lang.Long,java.lang.String)!找不到类型 Wallet 的属性 createWallet!
这是我的代码:
实体用户:
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<Wallet> wallets = new ArrayList<>();
public User() {
super();
}
public User(String name) …Run Code Online (Sandbox Code Playgroud) 我和Vaadin一起工作.我有一个文本字段和一个按钮.我的按钮最初被禁用.当我的文本字段填充有效数据时,我的按钮必须激活.我无法激活我的按钮.你可以帮帮我吗 ?谢谢
public static DynTextField createFromElement(Element elt, DynForm form) {
if (elt.getNodeName().equals("param") && elt.getAttribute("type").equals("TEXT")) {
DynTextField dtf = new DynTextField();
dtf.setForm(form);
if (elt.hasAttribute("texte"))
dtf.setCaption(elt.getAttribute("texte"));
dtf.nom = elt.getAttribute("nom");
if (elt.hasAttribute("FORMAT"))
dtf.setFormat(elt.getAttribute("FORMAT"));
dtf.setDescription(elt.getAttribute("description"));
dtf.setStyleName("param" + (elt.hasAttribute("class") ? elt.getAttribute("class") : ""));
return dtf;
} else
return null;
}
private void setFormat(String attribute) {
binder = new Binder<>();
binder.forField(this).withValidator(new RegexpValidator("Saisie obligatoire !!", attribute)).asRequired("Format Erroné").bind(No.getter(), No.setter());
//new Binder<>().forField(this).withValidator(new RegexpValidator(attribute, "Format Erroné")).asRequired();
}
// convenience empty getter and setter implementation for better readability
public static class …Run Code Online (Sandbox Code Playgroud)