Package org.apache.aries.samples.ariestrader.entities

Examples of org.apache.aries.samples.ariestrader.entities.AccountDataBeanImpl


                                                        + "a.OPENBALANCE, "
                                                        + "a.PROFILE_USERID "
                                                        + "from accountejb a where a.profile_userid = ?",
                                                        org.apache.aries.samples.ariestrader.entities.AccountDataBeanImpl.class);
                findaccountid.setParameter(1, userID);
                AccountDataBeanImpl account = (AccountDataBeanImpl) findaccountid.getSingleResult();
                Integer accountid = account.getAccountID();
                Query updateStatus = entityManager.createNativeQuery("UPDATE orderejb o SET o.orderStatus = 'completed' WHERE "
                                                                     + "o.orderStatus = 'closed' AND o.ACCOUNT_ACCOUNTID  = ?");
                updateStatus.setParameter(1, accountid.intValue());
                updateStatus.executeUpdate();
            }
View Full Code Here


                                    String fullname,
                                    String address,
                                    String email,
                                    String creditcard,
                                    BigDecimal openBalance) throws Exception {
        AccountDataBeanImpl account = null;
        AccountProfileDataBeanImpl profile = null;

        if (Log.doTrace())
            Log.trace("TradeJpaCm:register", userID, password, fullname, address, email, creditcard, openBalance);

        // Check to see if a profile with the desired userID already exists

        profile = entityManager.find(AccountProfileDataBeanImpl.class, userID);

        if (profile != null) {
            Log.error("Failed to register new Account - AccountProfile with userID(" + userID + ") already exists");
            return null;
        }
        else {
            profile = new AccountProfileDataBeanImpl(userID, password, fullname,
                                                 address, email, creditcard);
            account = new AccountDataBeanImpl(0, 0, null, new Timestamp(System.currentTimeMillis()), openBalance, openBalance, userID);
            profile.setAccount((AccountDataBean)account);
            account.setProfile((AccountProfileDataBean)profile);
            entityManager.persist(profile);
            entityManager.persist(account);
            // Uncomment this line to verify that datasources has been enlisted.  After rebuild attempt to register a user with
            // a user id "fail".  After the exception is thrown the database should not contain the user "fail" even though
            // the profile and account have already been persisted.
View Full Code Here

                                                        + "a.OPENBALANCE, "
                                                        + "a.PROFILE_USERID "
                                                        + "from accountejb a where a.profile_userid = ?",
                                                        org.apache.aries.samples.ariestrader.entities.AccountDataBeanImpl.class);
                findaccountid.setParameter(1, userID);
                AccountDataBeanImpl account = (AccountDataBeanImpl) findaccountid.getSingleResult();
                Integer accountid = account.getAccountID();
                Query updateStatus = entityManager.createNativeQuery("UPDATE orderejb o SET o.orderStatus = 'completed' WHERE "
                                                                     + "o.orderStatus = 'closed' AND o.ACCOUNT_ACCOUNTID  = ?");
                updateStatus.setParameter(1, accountid.intValue());
                updateStatus.executeUpdate();
            }
View Full Code Here

    }

    public AccountDataBean register(String userID, String password, String fullname,
                                    String address, String email, String creditcard,
                                    BigDecimal openBalance) {
        AccountDataBeanImpl account = null;
        AccountProfileDataBeanImpl profile = null;
        EntityManager entityManager = emf.createEntityManager();

        if (Log.doTrace())
            Log.trace("TradeJpaAm:register", userID, password, fullname, address, email, creditcard, openBalance);

        // Check to see if a profile with the desired userID already exists

        profile = entityManager.find(AccountProfileDataBeanImpl.class, userID);

        if (profile != null) {
            Log.error("Failed to register new Account - AccountProfile with userID(" + userID + ") already exists");
            return null;
        }
        else {
            profile = new AccountProfileDataBeanImpl(userID, password, fullname,
                                                 address, email, creditcard);
            account = new AccountDataBeanImpl(0, 0, null, new Timestamp(System.currentTimeMillis()), openBalance, openBalance, userID);
            profile.setAccount((AccountDataBean)account);
            account.setProfile((AccountProfileDataBean)profile);
            /*
             * managed Transaction
             */
            try {
                entityManager.getTransaction().begin();
View Full Code Here

TOP

Related Classes of org.apache.aries.samples.ariestrader.entities.AccountDataBeanImpl

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.