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

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -