Package javax.ejb

Examples of javax.ejb.NoSuchEntityException


      if (rs.next()) {
        balance = rs.getDouble(1);
      } else {
        String error = "ejbLoad: AccountBean (" + accountId + ") not found";
        log(error);
        throw new NoSuchEntityException (error);
       }
    } catch (SQLException sqe) {
      String error = "SQLException:  " + sqe.getMessage();
      log(error);
      throw new EJBException (error);
View Full Code Here


      ps.setDouble(1, balance);
      ps.setString(2, accountId);
      if (!(ps.executeUpdate() > 0)) {
        String error = "ejbStore: AccountBean (" + accountId + ") not updated";
        log(error);
        throw new NoSuchEntityException (error);
      }
    } catch(SQLException sqe) {
      String error = "SQLException:  " + sqe.getMessage();
      log(error);
      throw new EJBException (error);
View Full Code Here

      ps = con.prepareStatement("delete from finderEnum where id = ?");
      ps.setString(1, accountId);
      if (!(ps.executeUpdate() > 0)) {
        String error = "AccountBean (" + accountId + " not found";
        log(error);
        throw new NoSuchEntityException (error);
      }
    } catch (SQLException sqe) {
      String error = "SQLException:  " + sqe.getMessage();
      log(error);
      throw new EJBException (error);
View Full Code Here

                final PreparedStatement stmt = con.prepareStatement("select * from entity where id = ?");
                try {
                    stmt.setInt(1, primaryKey);
                    final ResultSet rs = stmt.executeQuery();
                    if (!rs.next()) {
                        throw new NoSuchEntityException("" + primaryKey);
                    }
                    lastName = rs.getString("last_name");
                    firstName = rs.getString("first_name");
                    if (rs.next()) {
                        throw new EJBException("Found more than one entity with id " + primaryKey);
View Full Code Here

                PreparedStatement stmt = con.prepareStatement("select * from entity where id = ?");
                try {
                    stmt.setInt(1, primaryKey);
                    ResultSet rs = stmt.executeQuery();
                    if (!rs.next()) {
                        throw new NoSuchEntityException("" + primaryKey);
                    }
                    lastName = rs.getString("last_name");
                    firstName = rs.getString("first_name");
                    if (rs.next()) {
                        throw new EJBException("Found more than one entity with id " + primaryKey);
View Full Code Here

                final PreparedStatement stmt = con.prepareStatement("select * from entity where id = ?");
                try {
                    stmt.setInt(1, primaryKey);
                    final ResultSet rs = stmt.executeQuery();
                    if (!rs.next()) {
                        throw new NoSuchEntityException("" + primaryKey);
                    }
                    lastName = rs.getString("last_name");
                    firstName = rs.getString("first_name");
                    if (rs.next()) {
                        throw new EJBException("Found more than one entity with id " + primaryKey);
View Full Code Here

                PreparedStatement stmt = con.prepareStatement("select * from entity where id = ?");
                try {
                    stmt.setInt(1, primaryKey);
                    ResultSet rs = stmt.executeQuery();
                    if (!rs.next()) {
                        throw new NoSuchEntityException("" + primaryKey);
                    }
                    lastName = rs.getString("last_name");
                    firstName = rs.getString("first_name");
                    if (rs.next()) {
                        throw new EJBException("Found more than one entity with id " + primaryKey);
View Full Code Here

            // clear LOAD_REQUIRED flag
            loadIter.removeAll();
            // did we load the main results
            if (!mainEntityLoaded) {
                if (failIfNotFound)
                    throw new NoSuchEntityException("Entity not found: primaryKey=" + ctx.getPrimaryKey());
                else
                    return false;
            } else
                return true;
        } catch (EJBException e) {
View Full Code Here

                }

                rs = ps.executeQuery();

                if (!rs.next()) {
                    throw new NoSuchEntityException("Row not found: " + pk);
                }

                value = field.loadArgumentResults(rs, 1);
            } catch (SQLException e) {
                throw new EJBException("Failed to load field " +
View Full Code Here

            }

            rs = ps.executeQuery();

            if (!rs.next()) {
                throw new NoSuchEntityException("Row not found: " + id);
            }

            return view.loadRow(rs, id, false);
        } catch (SQLException e) {
            log.error("Failed to load row: table=" + tableName + ", pk=" + id);
View Full Code Here

TOP

Related Classes of javax.ejb.NoSuchEntityException

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.