Package net.sourceforge.handhistorytool.persistance

Examples of net.sourceforge.handhistorytool.persistance.HandsEntity


                              'End If
                               * */
                                if (line.contains("End Of Hand #")) {
                                    //Only Continue if we have a valid table, hand and we were dealt in
                                    if (strTable != null && handNo != 0 && firstCard != null) {
                                        HandsEntity handsEntity = new HandsEntity();
                                        handsEntity.setStartdate(strDate);
                                        handsEntity.setTablename(strTable);
                                        handsEntity.setHandno(handNo);
                                        handsEntity.setWin(strWin);
                                        handsEntity.setProfit(profit);
                                        if (firstCard != null) {
                                            handsEntity.setHole1(firstCard.substring(0, 1));
                                            handsEntity.setHole1suit(firstCard.substring(1, 2));
                                        }
                                        if (secondCard != null) {
                                            handsEntity.setHole2(secondCard.substring(0, 1));
                                            handsEntity.setHole2suit(secondCard.substring(1, 2));
                                        }
                                        if (flopCard1 != null) {
                                            handsEntity.setBoard1(flopCard1.substring(0, 1));
                                            handsEntity.setBoard1suit(flopCard1.substring(1, 2));
                                        }
                                        if (flopCard2 != null) {
                                            handsEntity.setBoard2(flopCard2.substring(0, 1));
                                            handsEntity.setBoard2suit(flopCard2.substring(1, 2));
                                        }
                                        if (flopCard3 != null) {
                                            handsEntity.setBoard3(flopCard3.substring(0, 1));
                                            handsEntity.setBoard3suit(flopCard3.substring(1, 2));
                                        }
                                        if (turnCard != null) {
                                            handsEntity.setBoard4(turnCard.substring(0, 1));
                                            handsEntity.setBoard4suit(turnCard.substring(1, 2));
                                        }
                                        if (riverCard != null) {
                                            handsEntity.setBoard5(riverCard.substring(0, 1));
                                            handsEntity.setBoard5suit(riverCard.substring(1, 2));
                                        }

                                        createHandsEntity(handsEntity);

                                        //Reset for next hand
View Full Code Here


        Session session = SessionFactoryUtil.getInstance().getCurrentSession();
        try {
            tx = session.beginTransaction();
            List HandsEntitys = session.createQuery("select h from HandsEntity as h order by h.startdate desc").list();
            if (HandsEntitys.size() > 0) {
                HandsEntity element = (HandsEntity) HandsEntitys.get(0);
                startDate = element.getStartdate();
            }

            tx.commit();
        } catch (RuntimeException e) {
            if (tx != null && tx.isActive()) {
View Full Code Here

TOP

Related Classes of net.sourceforge.handhistorytool.persistance.HandsEntity

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.