当前位置: 首页>>代码示例>>Java>>正文


Java EntityMetadata类代码示例

本文整理汇总了Java中org.springframework.data.repository.core.EntityMetadata的典型用法代码示例。如果您正苦于以下问题:Java EntityMetadata类的具体用法?Java EntityMetadata怎么用?Java EntityMetadata使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


EntityMetadata类属于org.springframework.data.repository.core包,在下文中一共展示了EntityMetadata类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getEntityInformation

import org.springframework.data.repository.core.EntityMetadata; //导入依赖的package包/类
@Override
public EntityMetadata<?> getEntityInformation() {
    final Class<?> domainClass = getDomainClass();
    final DocumentDbEntityInformation<Object, String> entityInformation =
            new DocumentDbEntityInformation(domainClass);

    this.metadata = new SimpleDocumentDbEntityMetadata<Object>((Class<Object>) domainClass, entityInformation);
    return this.metadata;
}
 
开发者ID:Microsoft,项目名称:spring-data-documentdb,代码行数:10,代码来源:DocumentDbQueryMethod.java

示例2: renderQueryIfExpressionOrReturnQuery

import org.springframework.data.repository.core.EntityMetadata; //导入依赖的package包/类
/**
 * @param query,   the query expression potentially containing a SpEL expression. Must not be {@literal null}.}
 * @param metadata the {@link EntityMetadata} for the given entity. Must not be {@literal null}.
 * @param parser   Must not be {@literal null}.
 * @return
 */
private static String renderQueryIfExpressionOrReturnQuery(String query, EntityMetadata<?> metadata,
                                                           SpelExpressionParser parser) {

  Assert.notNull(query, "query must not be null!");
  Assert.notNull(metadata, "metadata must not be null!");
  Assert.notNull(parser, "parser must not be null!");

  if (!containsExpression(query)) {
    return query;
  }

  StandardEvaluationContext evalContext = new StandardEvaluationContext();
  evalContext.setVariable(ENTITY_NAME, metadata.getJavaType().getName());

  query = potentiallyQuoteExpressionsParameter(query);

  Expression expr = parser.parseExpression(query, ParserContext.TEMPLATE_EXPRESSION);

  String result = expr.getValue(evalContext, String.class);

  if (result == null) {
    return query;
  }

  return potentiallyUnquoteParameterExpressions(result);
}
 
开发者ID:hexagonframework,项目名称:spring-data-ebean,代码行数:33,代码来源:ExpressionBasedStringQuery.java

示例3: executeFind

import org.springframework.data.repository.core.EntityMetadata; //导入依赖的package包/类
@Override
protected FacetPage<?> executeFind(Query query) {
	Assert.isInstanceOf(FacetQuery.class, query);

	EntityMetadata<?> metadata = solrQueryMethod.getEntityInformation();
	return solrOperations.queryForFacetPage((FacetQuery) query, metadata.getJavaType());
}
 
开发者ID:yiduwangkai,项目名称:dubbox-solr,代码行数:8,代码来源:AbstractSolrQuery.java

示例4: execute

import org.springframework.data.repository.core.EntityMetadata; //导入依赖的package包/类
@Override
public Object execute(Query query) {
	EntityMetadata<?> metadata = solrQueryMethod.getEntityInformation();
	return solrOperations.queryForObject(query, metadata.getJavaType());
}
 
开发者ID:yiduwangkai,项目名称:dubbox-solr,代码行数:6,代码来源:AbstractSolrQuery.java

示例5: ExpressionBasedStringQuery

import org.springframework.data.repository.core.EntityMetadata; //导入依赖的package包/类
/**
 * Creates a new {@link ExpressionBasedStringQuery} for the given query and {@link EntityMetadata}.
 *
 * @param query    must not be {@literal null} or empty.
 * @param metadata must not be {@literal null}.
 * @param parser   must not be {@literal null}.
 */
public ExpressionBasedStringQuery(String query, EntityMetadata<?> metadata, SpelExpressionParser parser) {
  super(renderQueryIfExpressionOrReturnQuery(query, metadata, parser));
}
 
开发者ID:hexagonframework,项目名称:spring-data-ebean,代码行数:11,代码来源:ExpressionBasedStringQuery.java


注:本文中的org.springframework.data.repository.core.EntityMetadata类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。