congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Query.singleOrNull
Code IndexAdd Tabnine 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)

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

  • Start an intent from android
  • onRequestPermissionsResult (Fragment)
  • getExternalFilesDir (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Best IntelliJ plugins
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