我正在尝试找到一种在wicket页面中创建具有CRUD功能的表的方法。我从来没有和这样的事情一起工作过。我可以使用spring gui在这个youtube视频后创建一个Master Detail表单:
https://www.youtube.com/watch?v=l7pxkL2cZrw
但我无法找到一种方法来使用相同的表单数据(来自table1.java文件),它将其插入带有CRUD功能的wicket。欢迎提出任何建议,如果您需要更多信息,请与我们联系。
编辑: table1的代码示例我想在wicket上显示
@Entity
@Table(name = "table1", catalog = "mydatabase", schema = "")
@NamedQueries({
@NamedQuery(name = "Table1.findAll", query = "SELECT t FROM Table1 t"),
@NamedQuery(name = "Table1.findByNo", query = "SELECT t FROM Table1 t WHERE t.no = :no"),
@NamedQuery(name = "Table1.findByName", query = "SELECT t FROM Table1 t WHERE t.name = :name")})
public class Table1 implements Serializable {
@Transient
private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@Column(name = "no")
private Integer no;
@Column(name = "name")
private String name;
@Lob
@Column(name = "address")
private String address;
public Table1() {
}
public Table1(Integer no) {
this.no = no;
}
public Integer getNo() {
return no;
}
public void setNo(Integer no) {
Integer oldNo = this.no;
this.no = no;
changeSupport.firePropertyChange("no", oldNo, no);
}
public String getName() {
return name;
}
public void setName(String name) {
String oldName = this.name;
this.name = name;
changeSupport.firePropertyChange("name", oldName, name);
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
String oldAddress = this.address;
this.address = address;
changeSupport.firePropertyChange("address", oldAddress, address);
}
@Override
public int hashCode() {
int hash = 0;
hash += (no != null ? no.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Table1)) {
return false;
}
Table1 other = (Table1) object;
if ((this.no == null && other.no != null) || (this.no != null && !this.no.equals(other.no))) {
return false;
}
return true;
}
@Override
public String toString() {
return "javacrudapplication.Table1[ no=" + no + " ]";
}
public void addPropertyChangeListener(PropertyChangeListener listener) {
changeSupport.addPropertyChangeListener(listener);
}
public void removePropertyChangeListener(PropertyChangeListener listener) {
changeSupport.removePropertyChangeListener(listener);
}
}