hibernate - HQL Insert fails while selecting a record from a table and inserting selected records in another table? -


My HQL entry query fails when selecting a record from a table and inserting selected records in another table . I am getting a "debugging" message in all the lists and there is a repetitive list in the console, but that company is not able to include the records in the table.

DAo class code: -

  Public Zero Approved (Int. Company ID, String Verifier) ​​{session.beginTransaction (); Query query = session.createQuery ("temporary where companyID =?"); Query.setInteger (0, Company ID); @SuppressWarnings ("uncontrolled") list & lt; Provisional & gt; List = query.list (); Committed to session.getTransaction (). If (list.size ()> 0) {System.out.println ("inside the list"); (Provisional P: list) {System.out.println ("revision list"); Approve query = session. Create a company "(Company IDIID +, Annual Valvefottexport, Annual VolumeTileXport, Company, Company Name, Company Email, Company Name, Company Type, Contact Presentation, Contact Email," + "Contact ProsenceFax Anyone, ContactProfile Name, Contactphonephonephone, country id, fax no, "+" license, no, login id, old password, password, phone no, state id, texted, optional "+" VerifierID, website, zip code) value (?,?,?,?,?,?,?,?,?,?,??,?,?,?,?, "+"? ?,?,?,?,?,?,?,?,?,?,?,?,?) "); ApproveQuery.setParameter (1, p.getCompanyID ()); ApproveQuery.setParameter (2, p.getAnnualValueOfTotalExport ()); ApproveQuery.setParameter (3, p.getAnnualValueOfTotalSale ()); ApproveQuery.setParameter (4, p.getCityID ()); ApproveQuery.setParameter (5, p.getCompanyAddress ()); ApproveQuery.setParameter (6, p.getCompanyEmail ()); ApproveQuery.setParameter (7, p.getCompanyName ()); ApproveQuery.setParameter (8, p.getCompanyType ()); ApproveQuery.setParameter (9, p.getContactPersonPosition ()); ApproveQuery.setParameter (10, p.getContactPersonEmail ()); ApproveQuery.setParameter (11, p.getContactPersonFaxNo ()); ApproveQuery.setParameter (12, p.getContactPersonName ()); ApproveQuery.setParameter (13, p.getContactPersonPhoneNo ()); ApproveQuery.setParameter (14, p.getCountryID ()); ApproveQuery.setParameter (15, p.getFaxNo ()); ApproveQuery.setParameter (16, p.getLicenceNo ()); ApproveQuery.setParameter (17, p.getLoginID ()); ApproveQuery.setParameter (18, p.getPassword ()); ApproveQuery.setParameter (19, p.getPassword ()); ApproveQuery.setParameter (20, p.getPhoneNo ()); ApproveQuery.setParameter (21, p.getStateID ()); ApproveQuery.setParameter (22, p.getTaxID ()); ApproveQuery.setParameter (23, p.getCreated_On ()); ApproveQuery.setParameter (24, varifier); ApproveQuery.setParameter (25, p.getWebsite ()); ApproveQuery.setParameter (26, p.getZipCode ()); ApproveQuery.executeUpdate (); Session.getTransaction.commit (); }} Session.close (); }    

Why are you using the insert ....

Try to make company company = new company ();

Then set all the values ​​in this object and then .ave ();

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -