Package net.sf.chellow.monad

Examples of net.sf.chellow.monad.NotFoundException


  static public MarketRole getMarketRole(Long id) throws HttpException {
    MarketRole marketRole = (MarketRole) Hiber.session().get(
        MarketRole.class, id);
    if (marketRole == null) {
      throw new NotFoundException();
    }
    return marketRole;
  }
View Full Code Here


  static public MarketRole getMarketRole(char code) throws HttpException {
    MarketRole marketRole = (MarketRole) Hiber.session().createQuery(
        "from MarketRole role where role.code = :code").setCharacter(
        "code", code).uniqueResult();
    if (marketRole == null) {
      throw new NotFoundException();
    }
    return marketRole;
  }
View Full Code Here

  public Participant getChild(UriPathElement uriId) throws HttpException {
    try {
      return Participant.getParticipant(Long.parseLong(uriId.toString()));
    } catch (NumberFormatException e) {
      throw new NotFoundException();
    }
  }
View Full Code Here

  public GspGroup getChild(UriPathElement uriId) throws HttpException {
    try {
      return GspGroup.getGspGroup(Long.parseLong(uriId.toString()));
    } catch (NumberFormatException e) {
      throw new NotFoundException();
    }
  }
View Full Code Here

  public static final String COP_7 = "7";

  static public Cop getCop(Long id) throws HttpException {
    Cop cop = (Cop) Hiber.session().get(Cop.class, id);
    if (cop == null) {
      throw new NotFoundException("The CoP with id " + id + " can't be found.");
    }
    return cop;
  }
View Full Code Here

    code = code.trim();
    Cop type = (Cop) Hiber.session().createQuery(
        "from Cop cop where cop.code = :code").setString(
        "code", code).uniqueResult();
    if (type == null) {
      throw new NotFoundException("The CoP with code " + code + " can't be found.");
    }
    return type;
  }
View Full Code Here

  public static ChannelSnag getChannelSnag(Long id) throws HttpException {
    ChannelSnag snag = (ChannelSnag) Hiber.session().get(ChannelSnag.class,
        id);

    if (snag == null) {
      throw new NotFoundException();
    }
    return snag;
  }
View Full Code Here

    Urlable {

  static public Snag getSnag(Long id) throws InternalException, NotFoundException {
    Snag snag = (Snag) Hiber.session().get(Snag.class, id);
    if (snag == null) {
      throw new NotFoundException();
    }
    return snag;
  }
View Full Code Here

    cloned.setId(null);
    return cloned;
  }

  public Urlable getChild(UriPathElement uriId) throws HttpException {
    throw new NotFoundException();
  }
View Full Code Here

            "from SupplyGeneration supplyGeneration where supplyGeneration.supply = :supply and supplyGeneration.id = :supplyGenerationId")
        .setEntity("supply", supply)
        .setLong("supplyGenerationId", Long.parseLong(uriId.toString()))
        .uniqueResult();
    if (supplyGeneration == null) {
      throw new NotFoundException(
          "The Supply Generation cannot be found.");
    }
    return supplyGeneration;
  }
View Full Code Here

TOP

Related Classes of net.sf.chellow.monad.NotFoundException

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.