Tabnine Logo
Query.params
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: org.leapframework/leap-orm

/**
 * Sets the single arg as params.
 */
default Query<T> param(Object arg) {
  return params(new Object[]{arg});
}

origin: org.leapframework/leap-orm

/**
 * Sets a {@link ArrayParams} for jdbc placeholders in this query.
 */
default Query<T> params(Object[] args) {
  return params(new ArrayParams(args));
}

origin: org.leapframework/leap-orm

@Override
public Query<Record> createSqlQuery(String sql, Object... args) {
  return createSqlQuery(sql).params(args);
}
origin: org.leapframework/leap-orm

@Override
public Query<Record> createQuery(Map<String, Object> params) {
  return dao().createQuery(cmd).params(params);
}
origin: org.leapframework/leap-orm

@Override
public <T> Query<T> createQuery(Class<T> resultClass, Object[] args) {
  return dao().createQuery(resultClass, cmd).params(args);
}
origin: org.leapframework/leap-orm

@Override
public <T> Query<T> createQuery(Class<T> resultClass, Map<String, Object> params) {
  return dao().createQuery(resultClass, cmd).params(params);
}
origin: org.leapframework/leap-orm

@Override
public <T> Query<T> createQuery(Class<T> resultClass, Params params) {
  return dao().createQuery(resultClass, cmd).params(params);
}
origin: org.leapframework/leap-orm

@Override
public Query<Record> createQuery(Params params) {
  return dao().createQuery(cmd).params(params);
}
origin: org.leapframework/leap-orm

@Override
public Query<Record> createQuery(Object[] args) {
  return dao().createQuery(cmd).params(args);
}
origin: org.leapframework/leap-orm

/**
 * Sets all properties in the given pojo bean as query parameters. 
 */
Query<T> params(@Nullable DynaBean bean);

origin: org.leapframework/jmms-core

public Query<Record> createQuery(String sql, Map<String, Object> params) {
  Query<Record> query;
  if(sql.startsWith("@")) {
    String key = sql.substring(1);
    MetaSql sqlDef = sqls.get(key);
    if(null == sqlDef) {
      sqlDef = api.getMeta().getSql(key);
    }
    if(null != sqlDef) {
      //todo: cache the sql command.
      query = dao.createSqlQuery(Record.class, sqlDef.getScript());
    }else {
      query = dao.createNamedQuery(key, Record.class);
    }
  }else {
    query = dao.createSqlQuery(Record.class, sql);
  }
  if(null != params) {
    query.params(params);
  }
  return query;
}
origin: org.leapframework/leap-webapi

@Override
public Object apply(ActionParams params) {
  Map<String,Object> map = params.toMap();
  Object result;
  if(command.getMetadata().isSelect()) {
    //todo: page query, total count
    Query query = dao.createQuery(command).params(map);
    if(null != returnType) {
      if(returnType.isSimpleType()) {
        result = Converts.convert(query.scalarValueOrNull(), returnType.asSimpleType().getJavaType());
      }else if(returnType.isCollectionType() && returnType.asCollectionType().getElementType().isSimpleType()) {
        result = query.scalars().list(returnType.asCollectionType().getElementType().asSimpleType().getJavaType());
      }else {
        result = query.list();
      }
    }else {
      result = query.list();
    }
  }else{
    //todo: the return type must be simple type
    result = dao.executeUpdate(command, map);
    if(null != returnType) {
      result = Converts.convert(result, returnType.asSimpleType().getJavaType());
    }
  }
  return ApiResponse.of(result);
}
leap.orm.queryQueryparams

Javadoc

Sets all values in the given Params as query parameters.

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.
  • singleOrNull
    Executes this query and return the first row. Returns null if no result returned.
  • 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
  • putExtra (Intent)
  • onRequestPermissionsResult (Fragment)
  • compareTo (BigDecimal)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • Kernel (java.awt.image)
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Collectors (java.util.stream)
  • From CI to AI: The AI layer in your organization
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