+ "from accountejb a where a.profile_userid = ?",
org.apache.openjpa.integration.daytrader.AccountDataBean.class);
findaccountid.setParameter(1, userID);
AccountDataBean account = (AccountDataBean) 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();
}