org.datanucleus.store.query.Query.setImplicitParameter()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(6.4k)|赞(0)|评价(0)|浏览(87)

本文整理了Java中org.datanucleus.store.query.Query.setImplicitParameter方法的一些代码示例,展示了Query.setImplicitParameter的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.setImplicitParameter方法的具体详情如下:
包路径:org.datanucleus.store.query.Query
类名称:Query
方法名:setImplicitParameter

Query.setImplicitParameter介绍

暂无

代码示例

代码示例来源:origin: org.datanucleus/datanucleus-java5

/**
 * Bind an argument to a named parameter.
 * @param name the parameter name
 * @param value The value for the param
 * @return the same query instance
 * @throws IllegalArgumentException
 *     if parameter name does not correspond to parameter in query string or argument is of incorrect type
 */
public Query setParameter(String name, Object value)
{
  try
  {
    query.setImplicitParameter(name, value);
  }
  catch (QueryInvalidParametersException ipe)
  {
    throw new IllegalArgumentException(ipe.getMessage());
  }
  return this;
}

代码示例来源:origin: org.datanucleus/datanucleus-java5

/**
 * Bind an instance of java.util.Date to a named parameter.
 * @param name Name of the param
 * @param value Value for the param
 * @param temporalType The temporal type
 * @return the same query instance
 * @throws IllegalArgumentException
 *     if parameter name does not correspond to parameter in query string
 */
public Query setParameter(String name, Date value, TemporalType temporalType)
{
  // TODO Use "temporalType"
  try
  {
    query.setImplicitParameter(name, value);
  }
  catch (QueryInvalidParametersException ipe)
  {
    throw new IllegalArgumentException(ipe.getMessage());
  }
  return this;
}

代码示例来源:origin: org.datanucleus/datanucleus-java5

/**
 * Bind an instance of java.util.Calendar to a named parameter.
 * @param name name of the param
 * @param value Value for the param
 * @param temporalType The temporal type
 * @return the same query instance
 * @throws IllegalArgumentException
 *     if parameter name does not correspond to parameter in query string
 */
public Query setParameter(String name, Calendar value, TemporalType temporalType)
{
  // TODO Use "temporalType"
  try
  {
    query.setImplicitParameter(name, value);
  }
  catch (QueryInvalidParametersException ipe)
  {
    throw new IllegalArgumentException(ipe.getMessage());
  }
  return this;
}

代码示例来源:origin: org.datanucleus/datanucleus-jpa

/**
 * Bind an argument to a named parameter.
 * @param name the parameter name
 * @param value The value for the param
 * @return the same query instance
 * @throws IllegalArgumentException if parameter name does not correspond to parameter in query string
 *     or argument is of incorrect type
 */
public JPAQuery<X> setParameter(String name, Object value)
{
  try
  {
    query.setImplicitParameter(name, value);
  }
  catch (QueryInvalidParametersException ipe)
  {
    throw new IllegalArgumentException(ipe.getMessage(), ipe);
  }
  return this;
}

代码示例来源:origin: org.datanucleus/datanucleus-jpa

/**
 * Bind an argument to a positional parameter.
 * @param position Parameter position
 * @param value The value
 * @return the same query instance
 * @throws IllegalArgumentException if position does not correspond to positional parameter of query 
 *     or argument is of incorrect type
 */
public JPAQuery<X> setParameter(int position, Object value)
{
  try
  {
    query.setImplicitParameter(position, value);
  }
  catch (QueryInvalidParametersException ipe)
  {
    throw new IllegalArgumentException(ipe.getMessage(), ipe);
  }
  return this;
}

代码示例来源:origin: org.datanucleus/datanucleus-java5

/**
 * Bind an argument to a positional parameter.
 * @param position Parameter position
 * @param value The value
 * @return the same query instance
 * @throws IllegalArgumentException
 *     if position does not correspond to positional parameter of query or argument is of incorrect type
 */
public Query setParameter(int position, Object value)
{
  try
  {
    query.setImplicitParameter(position, value);
  }
  catch (QueryInvalidParametersException ipe)
  {
    throw new IllegalArgumentException(ipe.getMessage());
  }
  return this;
}

代码示例来源:origin: org.datanucleus/datanucleus-java5

/**
 * Bind an instance of java.util.Calendar to a positional parameter.
 * @param position Parameter position
 * @param value Value for the param
 * @param temporalType Temporal type
 * @return the same query instance
 * @throws IllegalArgumentException
 *     if position does not correspond to positional parameter of query
 */
public Query setParameter(int position, Calendar value, TemporalType temporalType)
{
  // TODO Use "temporalType"
  try
  {
    query.setImplicitParameter(position, value);
  }
  catch (QueryInvalidParametersException ipe)
  {
    throw new IllegalArgumentException(ipe.getMessage());
  }
  return this;
}

代码示例来源:origin: org.datanucleus/datanucleus-java5

/**
 * Bind an instance of java.util.Date to a positional parameter.
 * @param position Parameter position
 * @param value Value for the param
 * @param temporalType Temporal Type
 * @return the same query instance
 * @throws IllegalArgumentException
 *     if position does not correspond to positional parameter of query
 */
public Query setParameter(int position, Date value, TemporalType temporalType)
{
  // TODO Use "temporalType"
  try
  {
    query.setImplicitParameter(position, value);
  }
  catch (QueryInvalidParametersException ipe)
  {
    throw new IllegalArgumentException(ipe.getMessage());
  }
  return this;
}

代码示例来源:origin: org.datanucleus/datanucleus-jpa

/**
 * Bind an instance of java.util.Date to a named parameter.
 * @param name Name of the param
 * @param value Value for the param
 * @param temporalType The temporal type
 * @return the same query instance
 * @throws IllegalArgumentException if parameter name does not correspond to parameter in query string
 */
public JPAQuery<X> setParameter(String name, Date value, TemporalType temporalType)
{
  Object paramValue = value;
  if (temporalType == TemporalType.TIME && !(value instanceof Time))
  {
    paramValue = new Time(value.getTime());
  }
  else if (temporalType == TemporalType.TIMESTAMP && !(value instanceof Timestamp))
  {
    paramValue = new Timestamp(value.getTime());
  }
  try
  {
    query.setImplicitParameter(name, paramValue);
  }
  catch (QueryInvalidParametersException ipe)
  {
    throw new IllegalArgumentException(ipe.getMessage());
  }
  return this;
}

代码示例来源:origin: org.datanucleus/datanucleus-jpa

query.setImplicitParameter(position, paramValue);

代码示例来源:origin: org.datanucleus/datanucleus-jpa

/**
 * Bind an instance of java.util.Date to a positional parameter.
 * @param position Parameter position
 * @param value Value for the param
 * @param temporalType Temporal Type
 * @return the same query instance
 * @throws IllegalArgumentException if position does not correspond to positional parameter of query
 */
public JPAQuery<X> setParameter(int position, Date value, TemporalType temporalType)
{
  Object paramValue = value;
  if (temporalType == TemporalType.TIME && !(value instanceof Time))
  {
    paramValue = new Time(value.getTime());
  }
  else if (temporalType == TemporalType.TIMESTAMP && !(value instanceof Timestamp))
  {
    paramValue = new Timestamp(value.getTime());
  }
  try
  {
    query.setImplicitParameter(position, paramValue);
  }
  catch (QueryInvalidParametersException ipe)
  {
    throw new IllegalArgumentException(ipe.getMessage());
  }
  return this;
}

代码示例来源:origin: org.datanucleus/datanucleus-jpa

query.setImplicitParameter(name, paramValue);

相关文章