Package org.bat.client.model

Examples of org.bat.client.model.Monster


    Session session = HibernateUtil.getSessionFactory().openSession();
   
    MonsterHibernateDAO myDAO = new MonsterHibernateDAO();
    myDAO.setSession(session);
    Transaction tx = session.beginTransaction();
    Monster myMonster = myDAO.getMonsterByShortDesc(mobName);
    tx.commit();
    if (myMonster == null) {
      myHandler.debugInfo("New monster: "+mobName);
      tx = session.beginTransaction();
      myMonster = new Monster();
      myMonster.setShortDescription(mobName);
     
      session.save(myMonster);
      tx.commit();
      myHandler.debugInfo(".. added to the database with id: "+myMonster.getId());
    }
    tx = session.beginTransaction();
    KilledMonster myKill = new KilledMonster();
    myKill.setMonster(myMonster);
    myKill.setExpWorth(new Integer(expGained));
View Full Code Here

TOP

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

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.