io.ebean.Query.setRawSql()方法的使用及代码示例

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

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

Query.setRawSql介绍

[英]Set RawSql to use for this query.
[中]设置用于此查询的RawSql。

代码示例

代码示例来源:origin: io.ebean/ebean-querybean

/**
 * Set RawSql to use for this query.
 */
public R setRawSql(RawSql rawSql) {
 query.setRawSql(rawSql);
 return root;
}

代码示例来源:origin: org.actframework/act-ebean2

@Override
public EbeanQuery<MODEL_TYPE> setRawSql(RawSql rawSql) {
  q.setRawSql(rawSql);
  return this;
}

代码示例来源:origin: org.actframework/act-ebean

@Override
public EbeanQuery<MODEL_TYPE> setRawSql(RawSql rawSql) {
  q.setRawSql(rawSql);
  qReadOnly.setRawSql(rawSql);
  return this;
}

代码示例来源:origin: icode/ameba

/**
 * {@inheritDoc}
 * Sets <code>RawSql</code> to use for this query.
 */
public Query<T> setRawSql(RawSql rawSql) {
  return query().setRawSql(rawSql);
}

代码示例来源:origin: io.github.hexagonframework.data/spring-data-ebean

/**
 * Return a query using native SQL.
 *
 * @param sql native SQL.
 * @return the created Query using native SQL.
 */
@Override
public <T> Query<T> createSqlQuery(Class<T> entityType, String sql) {
  Assert.notNull(entityType, "entityType must not null");
  Assert.hasText(sql, "sql must has text");
  RawSqlBuilder rawSqlBuilder = RawSqlBuilder.parse(sql);
  return ebeanServer.find(entityType).setRawSql(rawSqlBuilder.create());
}

代码示例来源:origin: io.github.hexagonframework.data/spring-data-ebean

/**
 * Return a query using native SQL and column mapping.
 *
 * @param sql               native SQL
 * @param tableAliasMapping table alias mapping,key is tableAlias, value is propertyName.
 * @return the created Query using native SQL and column mapping config
 */
@Override
public <T> Query<T> createSqlQueryMappingTableAlias(Class<T> entityType,
                          String sql,
                          Map<String, String> tableAliasMapping) {
  Assert.notNull(entityType, "entityType must not null");
  Assert.hasText(sql, "sql must has text");
  Assert.notEmpty(tableAliasMapping, "tableAliasMapping must not empty");
  RawSqlBuilder rawSqlBuilder = RawSqlBuilder.parse(sql);
  tableAliasMapping.entrySet().forEach(entry -> {
    rawSqlBuilder.tableAliasMapping(entry.getKey(), entry.getValue());
  });
  return ebeanServer.find(entityType).setRawSql(rawSqlBuilder.create());
}

代码示例来源:origin: hexagonframework/spring-data-ebean

/**
 * Return a query using native SQL.
 *
 * @param sql native SQL.
 * @return the created Query using native SQL.
 */
@Override
public <T> Query<T> createSqlQuery(Class<T> entityType, String sql) {
  Assert.notNull(entityType, "entityType must not null");
  Assert.hasText(sql, "sql must has text");
  RawSqlBuilder rawSqlBuilder = RawSqlBuilder.parse(sql);
  return ebeanServer.find(entityType).setRawSql(rawSqlBuilder.create());
}

代码示例来源:origin: hexagonframework/spring-data-ebean

/**
 * Return a query using native SQL and column mapping.
 *
 * @param sql           native SQL
 * @param columnMapping column mapping,key is dbColumn, value is propertyName.
 * @return the created Query using native SQL and column mapping config.
 */
@Override
public <T> Query<T> createSqlQueryMappingColumns(Class<T> entityType,
                         String sql,
                         Map<String, String> columnMapping) {
  Assert.notNull(entityType, "entityType must not null");
  Assert.hasText(sql, "sql must has text");
  Assert.notEmpty(columnMapping, "columnMapping must not empty");
  RawSqlBuilder rawSqlBuilder = RawSqlBuilder.parse(sql);
  columnMapping.entrySet().forEach(entry -> {
    rawSqlBuilder.columnMapping(entry.getKey(), entry.getValue());
  });
  return ebeanServer.find(entityType).setRawSql(rawSqlBuilder.create());
}

代码示例来源:origin: io.github.hexagonframework.data/spring-data-ebean

/**
 * Return a query using native SQL and column mapping.
 *
 * @param sql           native SQL
 * @param columnMapping column mapping,key is dbColumn, value is propertyName.
 * @return the created Query using native SQL and column mapping config.
 */
@Override
public <T> Query<T> createSqlQueryMappingColumns(Class<T> entityType,
                         String sql,
                         Map<String, String> columnMapping) {
  Assert.notNull(entityType, "entityType must not null");
  Assert.hasText(sql, "sql must has text");
  Assert.notEmpty(columnMapping, "columnMapping must not empty");
  RawSqlBuilder rawSqlBuilder = RawSqlBuilder.parse(sql);
  columnMapping.entrySet().forEach(entry -> {
    rawSqlBuilder.columnMapping(entry.getKey(), entry.getValue());
  });
  return ebeanServer.find(entityType).setRawSql(rawSqlBuilder.create());
}

代码示例来源:origin: hexagonframework/spring-data-ebean

/**
 * Return a query using native SQL and column mapping.
 *
 * @param sql               native SQL
 * @param tableAliasMapping table alias mapping,key is tableAlias, value is propertyName.
 * @return the created Query using native SQL and column mapping config
 */
@Override
public <T> Query<T> createSqlQueryMappingTableAlias(Class<T> entityType,
                          String sql,
                          Map<String, String> tableAliasMapping) {
  Assert.notNull(entityType, "entityType must not null");
  Assert.hasText(sql, "sql must has text");
  Assert.notEmpty(tableAliasMapping, "tableAliasMapping must not empty");
  RawSqlBuilder rawSqlBuilder = RawSqlBuilder.parse(sql);
  tableAliasMapping.entrySet().forEach(entry -> {
    rawSqlBuilder.tableAliasMapping(entry.getKey(), entry.getValue());
  });
  return ebeanServer.find(entityType).setRawSql(rawSqlBuilder.create());
}

相关文章

Query类方法