Open soumyadip007 opened 4 years ago
package com.example.demo.model;
import javax.persistence.*; import javax.validation.Valid; import javax.validation.constraints.NotBlank; import java.util.ArrayList; import java.util.HashMap; import java.util.List;
/**
Created by jjmendoza on 31/8/2018. */ //@Entity public class Person {
// @Id // @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id;
// @NotBlank private String name;
// @NotBlank private String lastName;
// @Valid // @OneToMany(cascade = CascadeType.ALL) // @JoinColumn(name = "person_id") private List contactList = new ArrayList<>();
public List testList = new ArrayList<>();
public HashMap<String,String> hm=new HashMap<String, String>();
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 String getLastName() { return lastName; }
public void setLastName(String lastName) { this.lastName = lastName; }
public List getContactList() { return contactList; }
public void setContactList(List contactList) { this.contactList = contactList; }
public List getTestList() { return testList; }
public void setTestList(List testList) { this.testList = testList; }
public HashMap<String, String> getHm() { return hm; }
public void setHm(HashMap<String, String> hm) { this.hm = hm; }
@Override public String toString() {
for(Contact s:contactList) System.out.println(s.toString()); for(String s:testList) System.out .println(s+"1212121212 \n\n"); return "Person [id=" + id + ", name=" + name + ", lastName=" + lastName + ", contactList=" + contactList + ", testList=" + testList + ", hm=" + hm + "]";
}
Expected Behavior
package com.example.demo.model;
import javax.persistence.*; import javax.validation.Valid; import javax.validation.constraints.NotBlank; import java.util.ArrayList; import java.util.HashMap; import java.util.List;
/**
Created by jjmendoza on 31/8/2018. */ //@Entity public class Person {
// @Id // @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id;
// @NotBlank private String name;
// @NotBlank private String lastName;
// @Valid // @OneToMany(cascade = CascadeType.ALL) // @JoinColumn(name = "person_id") private List contactList = new ArrayList<>();
public List testList = new ArrayList<>();
public HashMap<String,String> hm=new HashMap<String, String>();
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 String getLastName() { return lastName; }
public void setLastName(String lastName) { this.lastName = lastName; }
public List getContactList() {
return contactList;
}
public void setContactList(List contactList) {
this.contactList = contactList;
}
public List getTestList() {
return testList;
}
public void setTestList(List testList) {
this.testList = testList;
}
public HashMap<String, String> getHm() { return hm; }
public void setHm(HashMap<String, String> hm) { this.hm = hm; }
@Override public String toString() {
}
}