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

sql - Time in datatime field -

javascript - How to split the success output from an Ajax post? -

java - sharing object across different classes -