Codota Logo
Query.singleOrNull
Code IndexAdd Codota to your IDE (free)

How to use
singleOrNull
method
in
leap.orm.query.Query

Best Java code snippets using leap.orm.query.Query.singleOrNull (Showing top 6 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Point p =
  • Codota Iconnew Point(x, y)
  • Codota Iconnew Point()
  • Codota IconMouseEvent e;e.getPoint()
  • Smart code suggestions by Codota
}
origin: org.leapframework/leap-websecurity

@Override
public UserDetails loadUserDetailsById(Object userId) {
  return lazyDao.get()
       .createNamedQuery(SQL_KEY_FIND_USER_DETAILS_BY_ID, SimpleUserDetails.class)
       .param(SQL_PARAM_USER_ID, userId)
       .singleOrNull();
}
origin: org.leapframework/leap-websecurity

@Override
public UserDetails loadUserDetailsByLoginName(String username) {
  return lazyDao.get()
      .createNamedQuery(SQL_KEY_FIND_USER_DETAILS_BY_LOGIN_NAME, SimpleUserDetails.class)
      .param(SQL_PARAM_LOGIN_NAME, username)
      .singleOrNull();
}
origin: org.leapframework/leap-oauth2-server

@Override
public AuthzSSOSession loadSessionById(String id) {
  AuthzSSOSessionEntity session = null;
  if(null != loadSessionByIdCommand) {
    session = dao.createQuery(AuthzSSOSessionEntity.class, loadSessionByIdCommand).singleOrNull();
  }else{
    session = dao.createCriteriaQuery(AuthzSSOSessionEntity.class)
        .where("id = ? and expiration > ?", new Object[]{id, new Date()})
        .singleOrNull();
  }
  if(null == session) {
    return null;
  }
  return createSessionFromEntity(session);
}
origin: org.leapframework/leap-oauth2-server

@Override
public AuthzSSOSession loadSessionByToken(String username, String token) {
  AuthzSSOSessionEntity session = null;
  if(null != loadSessionByTokenCommand) {
    session = dao.createQuery(AuthzSSOSessionEntity.class, loadSessionByTokenCommand).singleOrNull();
  }else{
    session = dao.createCriteriaQuery(AuthzSSOSessionEntity.class)
           .where("token = ? and user_name = ? and expiration > ?", new Object[]{token, username, new Date()})
           .firstOrNull();
  }
  if(null == session) {
    return null;
  }
  return createSessionFromEntity(session);
}
origin: org.leapframework/leap-oauth2

@Override
public AuthzSSOSession loadSessionByToken(String username, String token) {
  AuthzSSOSessionEntity session = null;
  if(null != loadSessionByTokenCommand) {
    session = dao.createQuery(AuthzSSOSessionEntity.class, loadSessionByTokenCommand).singleOrNull();
  }else{
    session = dao.createCriteriaQuery(AuthzSSOSessionEntity.class)
           .where("token = ? and user_name = ? and expiration > ?", new Object[]{token, username, new Date()})
           .firstOrNull();
  }
  if(null == session) {
    return null;
  }
  return createSessionFromEntity(session);
}
origin: org.leapframework/leap-oauth2

@Override
public AuthzSSOSession loadSessionById(String id) {
  AuthzSSOSessionEntity session = null;
  if(null != loadSessionByIdCommand) {
    session = dao.createQuery(AuthzSSOSessionEntity.class, loadSessionByIdCommand).singleOrNull();
  }else{
    session = dao.createCriteriaQuery(AuthzSSOSessionEntity.class)
        .where("id = ? and expiration > ?", new Object[]{id, new Date()})
        .singleOrNull();
  }
  if(null == session) {
    return null;
  }
  return createSessionFromEntity(session);
}
leap.orm.queryQuerysingleOrNull

Javadoc

Executes this query and return the first row.

Returns null if no result returned.

Popular methods of Query

  • list
    Executes this query and return all the rows as a immutable List object. Returns a empty immutable Li
  • firstOrNull
    Executes this query and return the first row. Returns null if no result returned.
  • params
    Sets a ArrayParams for jdbc placeholders in this query.
  • result
    Executes this query and return the query result.
  • scalarOrNull
    Returns the Scalar value in this query result or null if no records returned.
  • scalars
    Returns all the scalar values of the first column in this query result.
  • count
    Executes a count(*) query and returns the total count of records.
  • pageResult
  • param
  • scalar
    Returns the Scalar value in this query result.
  • scalarValueOrNull
    Returns the scalar value or null if n o records returned.
  • scalarValueOrNull

Popular in Java

  • Making http requests using okhttp
  • putExtra (Intent)
  • notifyDataSetChanged (ArrayAdapter)
  • orElseThrow (Optional)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Hashtable (java.util)
    Hashtable is a synchronized implementation of Map. All optional operations are supported.Neither key
  • SortedSet (java.util)
    A Set that further provides a total ordering on its elements. The elements are ordered using their C
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now