java - Illegal argument error while setting foreign key -


org.springframework.web.util.nestedservletexception: handler dispatch failed; nested exception java.lang.error: unresolved compilation problem: method settbldepartment(tbldepartment) in type tblproject not applicable arguments (long)

code in service layer

public void setfkdeptidforproject(long projectid, long departmentid) {     tblproject existproj=projectdao.get(projectid);     tbldepartment dept= new tbldepartment();     dept.setpkdepartmentid(departmentid);     existproj.settbldepartment(dept);     projectdao.update(existproj); } 

tblproject.class

@manytoone(fetch = fetchtype.lazy) @joincolumn(name = "fk_department_id") public tbldepartment gettbldepartment() {     return this.tbldepartment; }  public void settbldepartment(tbldepartment tbldepartment) {     this.tbldepartment = tbldepartment; } 


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -