• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Query类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



Query类属于com.datastax.driver.mapping.annotations包,在下文中一共展示了Query类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: generateSpecificGet

import com.datastax.driver.mapping.annotations.Query; //导入依赖的package包/类
private static MethodSpec generateSpecificGet(TableMetadata table, ClassName entityTable, int desiredColumns) {
    String query = getBaseQuery(table) + " WHERE ";
    MethodSpec.Builder builder = MethodSpec.methodBuilder("getAll");

    List<ColumnMetadata> columns = table.getPrimaryKey();
    for(int i = 0; i < desiredColumns; i++) {
        ColumnMetadata column = columns.get(i);
        String name = column.getName();
        String newClause = name + "=:" + name;
        if(i != 0) {
            newClause = " AND " + newClause;
        }
        query += newClause;
        builder.addParameter(getSpec(column, true));
    }

    return builder.addModifiers(Modifier.ABSTRACT).addModifiers(Modifier.PUBLIC)
            .returns(ParameterizedTypeName.get(ClassName.get(ListenableFuture.class),
                    ParameterizedTypeName.get(ClassName.get(Result.class), entityTable)))
            .addAnnotation(AnnotationSpec.builder(Query.class).addMember("value", "$S", query).build())
            .build();

}
 
开发者ID:jtruelove,项目名称:exovert,代码行数:24,代码来源:AccessorGenerator.java


示例2: generateAll

import com.datastax.driver.mapping.annotations.Query; //导入依赖的package包/类
private static MethodSpec generateAll(TableMetadata table, ClassName entityTable) {
    String query = getBaseQuery(table);

    return MethodSpec.methodBuilder("getAll")
            .addModifiers(Modifier.ABSTRACT).addModifiers(Modifier.PUBLIC)
            .returns(ParameterizedTypeName.get(ClassName.get(ListenableFuture.class),
                    ParameterizedTypeName.get(ClassName.get(Result.class), entityTable)))
            .addAnnotation(AnnotationSpec.builder(Query.class).addMember("value", "$S", query).build())
            .build();
}
 
开发者ID:jtruelove,项目名称:exovert,代码行数:11,代码来源:AccessorGenerator.java


示例3: addItemRefsToContainer

import com.datastax.driver.mapping.annotations.Query; //导入依赖的package包/类
@Query("UPDATE content_v2 SET "
        + "item_refs = item_refs + :refs, "
        + "upcoming = upcoming + :upcoming, "
        + "available = available + :available "
        + "WHERE id = :id")
Statement addItemRefsToContainer(
        @Param("id") Long id,
        @Param("refs") Map<Ref, PartialItemRef> itemRefs,
        @Param("upcoming") Map<Ref, ItemRefAndBroadcastRefs> upcoming,
        @Param("available") Map<Ref, ItemRefAndLocationSummaries> available
);
 
开发者ID:atlasapi,项目名称:atlas-deer,代码行数:12,代码来源:ContentAccessor.java


示例4: removeItemRefsFromContainer

import com.datastax.driver.mapping.annotations.Query; //导入依赖的package包/类
@Query("UPDATE content_v2 SET "
        + "item_refs = item_refs - :refs, "
        + "upcoming = upcoming - :upcoming, "
        + "available = available - :available "
        + "WHERE id = :id")
Statement removeItemRefsFromContainer(
        @Param("id") Long id,
        @Param("refs") Set<Ref> itemRefs,
        @Param("upcoming") Set<Ref> upcoming,
        @Param("available") Set<Ref> available
);
 
开发者ID:atlasapi,项目名称:atlas-deer,代码行数:12,代码来源:ContentAccessor.java


示例5: findAll

import com.datastax.driver.mapping.annotations.Query; //导入依赖的package包/类
@Query("SELECT * FROM " + WordCount.CQL_KEYSPACE_NAME + "." + WordCount.CQL_TABLE_NAME + " limit :max")
Result<WordCount> findAll(@Param("max") int max);
 
开发者ID:mcfongtw,项目名称:flink-cassandra-connector-examples,代码行数:3,代码来源:WordCountAccessor.java


示例6: findAll

import com.datastax.driver.mapping.annotations.Query; //导入依赖的package包/类
@Query("SELECT * FROM " + WikiEditRecord.CQL_KEYSPACE_NAME + "." + WikiEditRecord.CQL_TABLE_NAME + " limit :max")
Result<WikiEditRecord> findAll(@Param("max") int max);
 
开发者ID:mcfongtw,项目名称:flink-cassandra-connector-examples,代码行数:3,代码来源:WikiEditRecordAccessor.java


示例7: fetch

import com.datastax.driver.mapping.annotations.Query; //导入依赖的package包/类
@Query("SELECT * FROM " + KEY_SPACE + "." + ObjectEntity.TABLE)
Result<ObjectEntity> fetch();
 
开发者ID:mnemonic-no,项目名称:act-platform,代码行数:3,代码来源:ObjectAccessor.java


示例8: getObjectByTypeValue

import com.datastax.driver.mapping.annotations.Query; //导入依赖的package包/类
@Query("SELECT * FROM " + KEY_SPACE + "." + ObjectByTypeValueEntity.TABLE + " WHERE object_type_id = :type AND object_value = :value")
ObjectByTypeValueEntity getObjectByTypeValue(@Param("type") UUID objectTypeID, @Param("value") String objectValue);
 
开发者ID:mnemonic-no,项目名称:act-platform,代码行数:3,代码来源:ObjectAccessor.java


示例9: fetchObjectFactBindings

import com.datastax.driver.mapping.annotations.Query; //导入依赖的package包/类
@Query("SELECT * FROM " + KEY_SPACE + "." + ObjectFactBindingEntity.TABLE + " WHERE object_id = :id")
Result<ObjectFactBindingEntity> fetchObjectFactBindings(@Param("id") UUID id);
 
开发者ID:mnemonic-no,项目名称:act-platform,代码行数:3,代码来源:ObjectAccessor.java


示例10: fetch

import com.datastax.driver.mapping.annotations.Query; //导入依赖的package包/类
@Query("SELECT * FROM " + KEY_SPACE + "." + TABLE + " WHERE fact_id = :id")
Result<FactCommentEntity> fetch(@Param("id") UUID id);
 
开发者ID:mnemonic-no,项目名称:act-platform,代码行数:3,代码来源:FactCommentAccessor.java


示例11: fetchByValue

import com.datastax.driver.mapping.annotations.Query; //导入依赖的package包/类
@Query("SELECT * FROM " + KEY_SPACE + "." + TABLE + " WHERE value = :value")
Result<FactEntity> fetchByValue(@Param("value") String value);
 
开发者ID:mnemonic-no,项目名称:act-platform,代码行数:3,代码来源:FactAccessor.java


示例12: refreshLastSeenTimestamp

import com.datastax.driver.mapping.annotations.Query; //导入依赖的package包/类
@Query("UPDATE " + KEY_SPACE + "." + TABLE + " SET last_seen_timestamp = :timestamp WHERE id = :id")
void refreshLastSeenTimestamp(@Param("id") UUID id, @Param("timestamp") long timestamp);
 
开发者ID:mnemonic-no,项目名称:act-platform,代码行数:3,代码来源:FactAccessor.java


示例13: fetch

import com.datastax.driver.mapping.annotations.Query; //导入依赖的package包/类
@Query("SELECT * FROM " + KEY_SPACE + "." + TABLE)
Result<ObjectTypeEntity> fetch();
 
开发者ID:mnemonic-no,项目名称:act-platform,代码行数:3,代码来源:ObjectTypeAccessor.java


示例14: getByName

import com.datastax.driver.mapping.annotations.Query; //导入依赖的package包/类
@Query("SELECT * FROM " + KEY_SPACE + "." + TABLE + " WHERE name = :name")
ObjectTypeEntity getByName(@Param("name") String name);
 
开发者ID:mnemonic-no,项目名称:act-platform,代码行数:3,代码来源:ObjectTypeAccessor.java


示例15: fetch

import com.datastax.driver.mapping.annotations.Query; //导入依赖的package包/类
@Query("SELECT * FROM " + KEY_SPACE + "." + TABLE)
Result<FactTypeEntity> fetch();
 
开发者ID:mnemonic-no,项目名称:act-platform,代码行数:3,代码来源:FactTypeAccessor.java


示例16: getByName

import com.datastax.driver.mapping.annotations.Query; //导入依赖的package包/类
@Query("SELECT * FROM " + KEY_SPACE + "." + TABLE + " WHERE name = :name")
FactTypeEntity getByName(@Param("name") String name);
 
开发者ID:mnemonic-no,项目名称:act-platform,代码行数:3,代码来源:FactTypeAccessor.java


示例17: fetch

import com.datastax.driver.mapping.annotations.Query; //导入依赖的package包/类
@Query("SELECT * FROM " + KEY_SPACE + "." + TABLE + " WHERE fact_id = :id")
Result<FactAclEntity> fetch(@Param("id") UUID id);
 
开发者ID:mnemonic-no,项目名称:act-platform,代码行数:3,代码来源:FactAclAccessor.java


示例18: findOne

import com.datastax.driver.mapping.annotations.Query; //导入依赖的package包/类
@Query("SELECT * FROM metadata WHERE id = :id")
Metadata findOne(@Param("id") UUID id);
 
开发者ID:dalbelap,项目名称:flipper-reverse-image-search,代码行数:3,代码来源:MetadataAccessor.java


示例19: findAll

import com.datastax.driver.mapping.annotations.Query; //导入依赖的package包/类
@Query("SELECT * FROM metadata LIMIT 100")
Result<Metadata> findAll();
 
开发者ID:dalbelap,项目名称:flipper-reverse-image-search,代码行数:3,代码来源:MetadataAccessor.java


示例20: token

import com.datastax.driver.mapping.annotations.Query; //导入依赖的package包/类
@Query("SELECT * FROM metadata WHERE token(picture_id) > token(:start) LIMIT :total")
Result<Metadata> findAllOrdered(@Param("start") UUID start, @Param("total") long total);
 
开发者ID:dalbelap,项目名称:flipper-reverse-image-search,代码行数:3,代码来源:MetadataAccessor.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SeparatorFactory类代码示例发布时间:2022-05-22
下一篇:
Java KJLoger类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap