congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
NoResultException.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
io.yawp.repository.query.NoResultException
constructor

Best Java code snippets using io.yawp.repository.query.NoResultException.<init> (Showing top 5 results out of 315)

origin: feroult/yawp

public IdRef<T> onlyId() throws NoResultException, MoreThanOneResultException {
  List<IdRef<T>> ids = ids();
  if (ids.size() == 0) {
    throw new NoResultException();
  }
  if (ids.size() > 1) {
    throw new MoreThanOneResultException();
  }
  return ids.get(0);
}
origin: feroult/yawp

  public Object get(IdRef<?> id) {
    if (cache.containsKey(id)) {
      return cache.get(id);
    }
    if (noResults.contains(id)) {
      throw new NoResultException();
    }
    try {
      Object t = id.refetch();
      cache.put(id, t);
      return t;
    } catch (NoResultException e) {
      noResults.add(id);
      throw e;
    }
  }
}
origin: feroult/yawp

private T executeQueryOnly() throws MoreThanOneResultException {
  List<T> list = executeQuery();
  if (list.size() == 0) {
    throw new NoResultException();
  }
  if (list.size() == 1) {
    return list.get(0);
  }
  throw new MoreThanOneResultException();
}
origin: feroult/yawp

private static Object fetchOldObject(Object object) {
  ObjectHolder objectHolder = new ObjectHolder(object);
  if (objectHolder.getId() == null) {
    throw new NoResultException();
  }
  return objectHolder.getId().fetch();
}
origin: feroult/yawp

public T only() throws NoResultException, MoreThanOneResultException {
  r.namespace().set(getClazz());
  try {
    T object;
    if (isQueryById()) {
      object = executeQueryById();
    } else {
      object = executeQueryOnly();
    }
    if (object == null) {
      throw new NoResultException();
    }
    return object;
  } finally {
    r.namespace().reset();
  }
}
io.yawp.repository.queryNoResultException<init>

Popular methods of NoResultException

    Popular in Java

    • Start an intent from android
    • scheduleAtFixedRate (Timer)
    • addToBackStack (FragmentTransaction)
    • setRequestProperty (URLConnection)
    • RandomAccessFile (java.io)
      Allows reading from and writing to a file in a random-access manner. This is different from the uni-
    • HttpURLConnection (java.net)
      An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
    • ResultSet (java.sql)
      An interface for an object which represents a database table entry, returned as the result of the qu
    • Time (java.sql)
      Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
    • LinkedList (java.util)
      Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
    • TreeMap (java.util)
      Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
    • Best plugins for Eclipse
    Tabnine Logo
    • Products

      Search for Java codeSearch for JavaScript code
    • IDE Plugins

      IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
    • Company

      About UsContact UsCareers
    • Resources

      FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
    Get Tabnine for your IDE now