Package com.san.my.dao

Examples of com.san.my.dao.ObjectDAO


   */
  public static void main(String[] args) {
    final  String[] defaultConfigPaths = {AppConstants.APP_DAO_CONFIG,AppConstants.APP_BOTransaction_CONFIG,AppConstants.APP_CONFIG};         
         
      ApplicationContext appContext = new ClassPathXmlApplicationContext(defaultConfigPaths);
      ObjectDAO objectDAO = (ObjectDAO)appContext.getBean("objectDAO");
      Session session = objectDAO.getHibSession();
            Transaction tx = session.beginTransaction();
              AccountDO accountsDO = (AccountDO)session.load(AccountDO.class, 2);
             
            tx.commit();
            session.close();
            //accountsDO.setAccountId(2);
           session = objectDAO.getHibSession();
            tx = session.beginTransaction();
            accountsDO.setName("one4");
         session.update(accountsDO);
            tx.commit();
    }
View Full Code Here


                 txTemplate.execute(new TransactionCallbackWithoutResult() {
                     public void doInTransactionWithoutResult(TransactionStatus status)
                     {
                         try {
                          
                           ObjectDAO objectDAO = (ObjectDAO)fappContext.getBean("objectDAO");
                           Session session = objectDAO.getHibSession();
                           Transaction tx = session.beginTransaction();
                             AccountDO accountsDO = (AccountDO)session.load(AccountDO.class, 2);
                           tx.commit();
                           //accountsDO.setAccountId(2);
                           accountsDO.setName("gfeabcaaaaad");
                           accountsDO.setLoginName("gfeaaaaaaa");
                           session.merge(accountsDO);
                         
                           SlipDO slip  = (SlipDO)objectDAO.load(SlipDO.class,new Integer(21070));
                          
                         }
                         catch (Exception ex) {
                             status.setRollbackOnly();
                             ex.printStackTrace();                       
View Full Code Here

TOP

Related Classes of com.san.my.dao.ObjectDAO

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.