Java 类org.springframework.data.repository.core.EntityMetadata 实例源码

项目:spring-data-documentdb    文件:DocumentDbQueryMethod.java   
@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;
}
项目:spring-data-ebean    文件:ExpressionBasedStringQuery.java   
/**
 * @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);
}
项目:dubbox-solr    文件:AbstractSolrQuery.java   
@Override
protected FacetPage<?> executeFind(Query query) {
    Assert.isInstanceOf(FacetQuery.class, query);

    EntityMetadata<?> metadata = solrQueryMethod.getEntityInformation();
    return solrOperations.queryForFacetPage((FacetQuery) query, metadata.getJavaType());
}
项目:spring-data-solr    文件:AbstractSolrQuery.java   
@Override
protected FacetPage<?> executeFind(Query query) {
    Assert.isInstanceOf(FacetQuery.class, query);

    EntityMetadata<?> metadata = solrQueryMethod.getEntityInformation();
    return solrOperations.queryForFacetPage((FacetQuery) query, metadata.getJavaType());
}
项目:dubbox-solr    文件:AbstractSolrQuery.java   
protected Page<?> executeFind(Query query) {
    EntityMetadata<?> metadata = solrQueryMethod.getEntityInformation();
    return solrOperations.queryForPage(query, metadata.getJavaType());
}
项目:dubbox-solr    文件:AbstractSolrQuery.java   
protected HighlightPage<?> executeFind(Query query) {
    Assert.isInstanceOf(HighlightQuery.class, query);

    EntityMetadata<?> metadata = solrQueryMethod.getEntityInformation();
    return solrOperations.queryForHighlightPage((HighlightQuery) query, metadata.getJavaType());
}
项目:dubbox-solr    文件:AbstractSolrQuery.java   
@Override
public Object execute(Query query) {
    EntityMetadata<?> metadata = solrQueryMethod.getEntityInformation();
    return solrOperations.queryForObject(query, metadata.getJavaType());
}
项目:spring-data-solr    文件:AbstractSolrQuery.java   
protected Page<?> executeFind(Query query) {
    EntityMetadata<?> metadata = solrQueryMethod.getEntityInformation();
    return solrOperations.queryForPage(query, metadata.getJavaType());
}
项目:spring-data-solr    文件:AbstractSolrQuery.java   
protected HighlightPage<?> executeFind(Query query) {
    Assert.isInstanceOf(HighlightQuery.class, query);

    EntityMetadata<?> metadata = solrQueryMethod.getEntityInformation();
    return solrOperations.queryForHighlightPage((HighlightQuery) query, metadata.getJavaType());
}
项目:spring-data-solr    文件:AbstractSolrQuery.java   
@Override
public Object execute(Query query) {
    EntityMetadata<?> metadata = solrQueryMethod.getEntityInformation();
    return solrOperations.queryForObject(query, metadata.getJavaType());
}
项目:spring-data-ebean    文件:ExpressionBasedStringQuery.java   
/**
 * 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));
}