我希望使用java在XML数据库中添加,编辑,删除和删除条目。下面的代码包含我的XML数据库中条目的所有getter和setter。如何从我的XML中获取值到适当的对象?
public class contact implements Serializable{
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column
private int Id;
@Column
private String firstname;
@Column
private String lastname;
@Column
private String email;
public int getId() {
return Id;
}
public void setId(int Id) {
this.Id = Id;
}
public String getFirstname() {
return firstname;
}
public void setFirstname(String firstname) {
this.firstname = firstname;
}
public String getLastname() {
return lastname;
}
public void setLastname(String lastname) {
this.lastname = lastname;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public contact(int Id, String firstname, String lastname, String email) {
this.Id = Id;
this.firstname = firstname;
this.lastname = lastname;
this.email = email;
}