According to find conditions to meet the conditions set records, each record must be followed by a certain number of field values

  Abstract: According to find the conditions to meet the conditions set records, each record must be followed by a certain number of field values 

  Query function to be completed: 
  According to find conditions to meet the conditions set records, each record must be followed by a certain number of field values, such as: field F0000, F0015, F0030, F0045, F0100, F0115, F0130, F0145, F0200, F0215, F0230 , F0245, F0300, F0315, F033O analogy has been followed to F2345 
  Cycle to be the value of each field. 

  I do not know how to write the query? 


  Does anyone know! Kunrao I had this day, no more clues. Help hurry for everyone! 

  HQL hibernate inside the object, and object attributes are, as you direct look-up table with JDBC 

  Public void select () 
  ( 
  Session session = null; 
  Transaction tx = null; 
  List list = null; 
  Iterator iterator = null; 
  Try 
  ( 
  HibernateSessionFactory.getSession session = (); 
  Tx = session.beginTransaction (); 
  Session.createQuery list = ( "from Users"). List (); 
  For (= list.listIterator iterator (); iterator.hasNext ();) 
  ( 
  Users user = (Users) iterator.next (); 
  System.out.println (user.getId ()+"—"+ user.getUsername ()); 
  ) 
  / / Query q = session.createQuery ( "from Users as u where u.id> = 4 and u.username 'panyong'"); 
  / / List = q.list (); 
  / / For (int i = 0; i    / / ( 
  / / Users u = (Users) list.get (i); 
  / / System.out.println (u.getId ()+"—"+ u.getUsername ()); 
  / /) 

  Tx.commit (); 
  System.out.println ( "saved to the database"); 
  ) 
  Catch (Exception ex) 
  ( 
  Try 
  ( 
  Tx.rollback (); 
  ) 
  Catch (Exception ex1) 
  ( 
  Ex1.printStackTrace (); 
  ) 
  Ex.printStackTrace (); 
  ) 
  Finally 
  ( 
  Try 
  ( 
  Session.close (); 
  ) 
  Catch (Exception ex2) 
  ( 
  Ex2.printStackTrace (); 
  ) 
  ) 
  ) 


  I have been resolved, thank you! 

  ↑ Back 

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Facebook
  • DotNetKicks
  • DZone
  • Netvouz
  • Propeller

Tags: , ,

Releated Java Articles

Comments

Leave a Reply