Click here to Skip to main content
15,881,173 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I have vmscontactemail field in the database and models, when I debug the code it shows the above error when I execute that line at managerdetailsrepository.save

What I have tried:

DAO
@Modifying
   @Transactional
   @Query("UPDATE manager_details md SET md.vmsContactName=:VMSContactName, md.vmsContactPhone=:VMSContactPhone, md.vmsContactEmail=:VMSContactEmail, md.vmsPortal=:VMSPortal, md.state=:State, md.updatedAt=:updatedAt WHERE md.managerId = :manager_id")
   int updateManager(@Param("manager_id") String managerId, @Param("VMSContactName") String vmsContactName, @Param("VMSContactPhone") String vmsContactPhone, @Param("VMSContactEmail") String vmsContactEmail, @Param("VMSPortal") String vmsPortal, @Param("State") String state,@Param("updatedAt") String updatedAt);


model
private int page_no;
   private int limit;
   private String sortby; // Ascending / Descending
   private String orderby; // vmsContactName / vmsContactPhone
   private String vmsContactName;
   private String vmsContactPhone;
   private String vmsContactEmail;
   private String vmsPortal;
   private String state;
Posted
Comments
Richard MacCutchan 22-Sep-22 5:09am    
You have not shown the code that the error message refers to.
Auto Samachar 22-Sep-22 5:59am    
@Modifying
@Transactional
@Query("UPDATE manager_details md SET md.vmsContactName=:VMSContactName, md.vmsContactPhone=:VMSContactPhone, md.vmsContactEmail=:VMSContactEmail, md.vmsPortal=:VMSPortal, md.state=:State, md.updatedAt=:updatedAt WHERE md.managerId = :manager_id")
int updateManager(@Param("manager_id") String managerId, @Param("VMSContactName") String vmsContactName, @Param("VMSContactPhone") String vmsContactPhone, @Param("VMSContactEmail") String vmsContactEmail, @Param("VMSPortal") String vmsPortal, @Param("State") String state,@Param("updatedAt") String updatedAt);
Auto Samachar 22-Sep-22 6:00am    
13:07:33.054 [http-nio-8001-exec-2] INFO o.s.web.servlet.DispatcherServlet - Completed initialization in 10 ms
13:08:28.032 [http-nio-8001-exec-1] INFO com.recruit.api.utils.Constants - /2022-09-22 13:08:28/Manager Details /create/{"vmsContactPhone":"123456","vmsPortal":"vms","vmsContactName":"dharma","vmsContactEmail":"ad@ad.com","state":"nc","managerId":"1234566666"}/100
13:08:29.217 [http-nio-8001-exec-1] WARN o.h.e.jdbc.spi.SqlExceptionHelper - SQL Error: 1054, SQLState: 42S22
13:08:29.217 [http-nio-8001-exec-1] ERROR o.h.e.jdbc.spi.SqlExceptionHelper - Unknown column 'vms_contact_email' in 'field list'
13:08:29.674 [http-nio-8001-exec-1] INFO com.recruit.api.utils.Constants - /2022-09-22 13:08:29/Manager Details /create/could not execute statement; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not execute statement/500
Richard MacCutchan 22-Sep-22 6:16am    
The information you have captured is missing something, since the only reference to that field is in the error message. You need to do some debugging to find out where it is getting that bad fieldname from. That is not something that anyone here can do for you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900