Package org.bat.client.model

Examples of org.bat.client.model.Player


        Session session = HibernateUtil.getSessionFactory().openSession();
       
        PlayerHibernateDAO myDAO = new PlayerHibernateDAO();
        myDAO.setSession(session);
        Transaction tx = session.beginTransaction();
        Player myCustomer = myDAO.getPlayerByName(newCustomer);
        tx.commit();
        if (myCustomer == null) {
          myHandler.debugInfo("New player: "+newCustomer);
          tx = session.beginTransaction();
          myCustomer = new Player();
          myCustomer.setName(newCustomer);
         
          session.save(myCustomer);
          tx.commit();
          myHandler.debugInfo(".. added to the database with id: "+myCustomer.getId());
        }
        tx = session.beginTransaction();
        activeSession = new MerchantSession();
        activeSession.setCustomer(myCustomer);
        session.save(activeSession);
View Full Code Here

TOP

Related Classes of org.bat.client.model.Player

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.