public Queue getQueue(DbConn cnx) { List<Queue> qq = Queue.select(cnx, "q_select_by_id", this.queue_id); if (qq.size() == 0) { throw new NoResultException("No queue found"); } return qq.get(0); }
public Queue getQueue(DbConn cnx) { List<Queue> qq = Queue.select(cnx, "q_select_by_id", this.queue_id); if (qq.size() == 0) { throw new NoResultException("No queue found"); } return qq.get(0); }
private static JndiObjectResourceDto getUniqueJndiResource(DbConn cnx, String query_key, Object key) { List<JndiObjectResourceDto> res = getJndiObjectResources(cnx, query_key, key); if (res.isEmpty()) { throw new NoResultException("The query returned zero rows when one was expected."); } if (res.size() > 1) { throw new NonUniqueResultException("The query returned more than one row when one was expected"); } return res.get(0); }
public static JobDef select_key(DbConn cnx, String name) { List<JobDef> res = select(cnx, "jd_select_by_key", name); if (res.isEmpty()) { throw new NoResultException("no result for query by key for key " + name); } if (res.size() > 1) { throw new DatabaseException("Inconsistent database! Multiple results for query by key for key " + name); } return res.get(0); }
public static PKI select_key(DbConn cnx, String key) { List<PKI> pp = select(cnx, "pki_select_by_key", key); if (pp.size() == 0) { throw new NoResultException("No PKI with key " + key); } if (pp.size() > 1) { throw new NonUniqueResultException("Configuration is not valid"); } return pp.get(0); }
public static Queue select_key(DbConn cnx, String name) { List<Queue> res = select(cnx, "q_select_by_key", name); if (res.isEmpty()) { throw new NoResultException("no result for query by key for key " + name); } if (res.size() > 1) { throw new DatabaseException("Inconsistent database! Multiple results for query by key for key " + name); } return res.get(0); }
public static Queue select_key(DbConn cnx, String name) { List<Queue> res = select(cnx, "q_select_by_key", name); if (res.isEmpty()) { throw new NoResultException("no result for query by key for key " + name); } if (res.size() > 1) { throw new DatabaseException("Inconsistent database! Multiple results for query by key for key " + name); } return res.get(0); }
public static JobDef select_key(DbConn cnx, String name) { List<JobDef> res = select(cnx, "jd_select_by_key", name); if (res.isEmpty()) { throw new NoResultException("no result for query by key for key " + name); } if (res.size() > 1) { throw new DatabaseException("Inconsistent database! Multiple results for query by key for key " + name); } return res.get(0); }
public static RUser selectlogin(DbConn cnx, String id) { List<RUser> res = select(cnx, "user_select_by_key", id); if (res.isEmpty()) { throw new NoResultException("no result for query by key for key " + id); } if (res.size() > 1) { throw new NonUniqueResultException("Inconsistent database! Multiple results for query by key for key " + id); } return res.get(0); } }
public static PKI select_key(DbConn cnx, String key) { List<PKI> pp = select(cnx, "pki_select_by_key", key); if (pp.size() == 0) { throw new NoResultException("No PKI with key " + key); } if (pp.size() > 1) { throw new NonUniqueResultException("Configuration is not valid"); } return pp.get(0); }
public static Cl select_key(DbConn cnx, String name) { List<Cl> res = select(cnx, "cl_select_by_key", name); if (res.isEmpty()) { throw new NoResultException("no result for query by key for key " + name); } if (res.size() > 1) { throw new DatabaseException("Inconsistent database! Multiple results for query by key for key " + name); } return res.get(0); }
private static JndiObjectResourceDto getUniqueJndiResource(DbConn cnx, String query_key, Object key) { List<JndiObjectResourceDto> res = getJndiObjectResources(cnx, query_key, key); if (res.isEmpty()) { throw new NoResultException("The query returned zero rows when one was expected."); } if (res.size() > 1) { throw new NonUniqueResultException("The query returned more than one row when one was expected"); } return res.get(0); }
public static JndiObjectResource select_alias(DbConn cnx, String alias) { List<JndiObjectResource> res = select(cnx, "jndi_select_by_key", alias); if (res.isEmpty()) { throw new NoResultException("no result for query by key for key " + alias); } if (res.size() > 1) { throw new NonUniqueResultException("Inconsistent database! Multiple results for query by key for key " + alias); } return res.get(0); } }
public static Node select_single(DbConn cnx, String query_key, Object... args) { List<Node> nn = select(cnx, query_key, args); if (nn.size() == 0) { throw new NoResultException("No node with this ID"); } if (nn.size() > 1) { throw new NonUniqueResultException("COnfiguration is broken: multiple nodes with the same ID"); } return nn.get(0); } }
public static JndiObjectResource select_alias(DbConn cnx, String alias) { List<JndiObjectResource> res = select(cnx, "jndi_select_by_key", alias); if (res.isEmpty()) { throw new NoResultException("no result for query by key for key " + alias); } if (res.size() > 1) { throw new NonUniqueResultException("Inconsistent database! Multiple results for query by key for key " + alias); } return res.get(0); } }
public static Cl select_key(DbConn cnx, String name) { List<Cl> res = select(cnx, "cl_select_by_key", name); if (res.isEmpty()) { throw new NoResultException("no result for query by key for key " + name); } if (res.size() > 1) { throw new DatabaseException("Inconsistent database! Multiple results for query by key for key " + name); } return res.get(0); }
public static RUser selectlogin(DbConn cnx, String id) { List<RUser> res = select(cnx, "user_select_by_key", id); if (res.isEmpty()) { throw new NoResultException("no result for query by key for key " + id); } if (res.size() > 1) { throw new NonUniqueResultException("Inconsistent database! Multiple results for query by key for key " + id); } return res.get(0); } }
public static Node select_single(DbConn cnx, String query_key, Object... args) { List<Node> nn = select(cnx, query_key, args); if (nn.size() == 0) { throw new NoResultException("No node with this ID"); } if (nn.size() > 1) { throw new NonUniqueResultException("COnfiguration is broken: multiple nodes with the same ID"); } return nn.get(0); } }
private static GlobalParameterDto getGlobalParameter(DbConn cnx, String query_key, Object key) { ResultSet rs = cnx.runSelect(query_key, key); try { if (!rs.next()) { throw new NoResultException("The query returned zero rows when one was expected."); } GlobalParameterDto res = mapGlobalParameter(rs); if (rs.next()) { throw new NonUniqueResultException("The query returned more than one row when one was expected"); } rs.close(); return res; } catch (SQLException e) { throw new JqmAdminApiInternalException("An error occurred while querying the database", e); } }
throw new NoResultException("The query returned zero rows when one was expected.");