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

Java Table类代码示例

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

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



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

示例1: item

import com.jcabi.dynamo.Table; //导入依赖的package包/类
/**
 * The item to work with.
 * @return Item to work with
 * @throws Exception If some problem inside
 */
private static Item item() throws Exception {
    final Region region = new MkRegion(
        new H2Data().with(
            "domains",
            new String[] {"domain"},
            "owner", "usage", "total"
        )
    );
    final Table table = region.table("domains");
    table.put(
        new Attributes()
            .with("domain", "yegor256.com")
            .with("owner", new AttributeValue("yegor256"))
            .with("usage", new AttributeValue("<usage/>"))
            .with("total", new AttributeValue().withN("0"))
    );
    return table.frame()
        .where("domain", "yegor256.com")
        .iterator().next();
}
 
开发者ID:yegor256,项目名称:jare,代码行数:26,代码来源:DyUsageTest.java


示例2: storesAndReadsSingleAttribute

import com.jcabi.dynamo.Table; //导入依赖的package包/类
/**
 * MkRegion can store and read items.
 * @throws Exception If some problem inside
 */
@Test
public void storesAndReadsSingleAttribute() throws Exception {
    final String table = "ideas";
    final String key = "number";
    final String attr = "total";
    final Region region = new MkRegion(
        new H2Data().with(table, new String[] {key}, attr)
    );
    final Table tbl = region.table(table);
    tbl.put(
        new Attributes()
            .with(key, "32443")
            .with(attr, "0")
    );
    final Item item = tbl.frame().iterator().next();
    item.put(
        attr,
        new AttributeValueUpdate().withValue(
            new AttributeValue().withN("2")
        ).withAction(AttributeAction.PUT)
    );
    MatcherAssert.assertThat(item.get(attr).getN(), Matchers.equalTo("2"));
}
 
开发者ID:jcabi,项目名称:jcabi-dynamo,代码行数:28,代码来源:MkRegionTest.java


示例3: retriesDelete

import com.jcabi.dynamo.Table; //导入依赖的package包/类
/**
 * ReTable can retry delete calls to method delete.
 * @throws Exception If some problem inside
 */
@Test
public void retriesDelete() throws Exception {
    final Table table = Mockito.mock(Table.class);
    final Attributes attrs = new Attributes();
    final String msg = "Exception!";
    Mockito.doThrow(new IOException(msg)).when(table)
        .delete(attrs);
    final Table retry = new ReTable(table);
    try {
        retry.delete(attrs);
    } catch (final IOException ex) {
        MatcherAssert.assertThat(ex.getMessage(), Matchers.equalTo(msg));
    }
    Mockito.verify(table, Mockito.times(Tv.THREE)).delete(attrs);
}
 
开发者ID:jcabi,项目名称:jcabi-dynamo,代码行数:20,代码来源:ReTableTest.java


示例4: table

import com.jcabi.dynamo.Table; //导入依赖的package包/类
@Override
public Table table(final String name) {
    try {
        return Dynamo.live().table(name);
    } catch (final IOException ex) {
        throw new IllegalStateException(ex);
    }
}
 
开发者ID:yegor256,项目名称:jpeek,代码行数:9,代码来源:Dynamo.java


示例5: storesAndReadsAttributes

import com.jcabi.dynamo.Table; //导入依赖的package包/类
/**
 * MkRegion can store and read items.
 * @throws Exception If some problem inside
 */
@Test
public void storesAndReadsAttributes() throws Exception {
    final String name = "users";
    final String key = "id";
    final String attr = "description";
    final String nattr = "thenumber";
    final Region region = new MkRegion(
        new H2Data().with(name, new String[] {key}, attr, nattr)
    );
    final Table table = region.table(name);
    table.put(
        new Attributes()
            .with(key, "32443")
            .with(attr, "first value to \n\t€ save")
            .with(nattr, "150")
    );
    final Item item = table.frame().iterator().next();
    MatcherAssert.assertThat(item.has(attr), Matchers.is(true));
    MatcherAssert.assertThat(
        item.get(attr).getS(),
        Matchers.containsString("\n\t\u20ac save")
    );
    item.put(
        attr,
        new AttributeValueUpdate().withValue(
            new AttributeValue("this is another value")
        )
    );
    MatcherAssert.assertThat(
        item.get(attr).getS(),
        Matchers.containsString("another value")
    );
    MatcherAssert.assertThat(
        item.get(nattr).getN(),
        Matchers.endsWith("50")
    );
}
 
开发者ID:jcabi,项目名称:jcabi-dynamo,代码行数:42,代码来源:MkRegionTest.java


示例6: table

import com.jcabi.dynamo.Table; //导入依赖的package包/类
@Override
public Table table(final String name) {
    return this.region.table(name);
}
 
开发者ID:yegor256,项目名称:rehttp,代码行数:5,代码来源:Dynamo.java


示例7: table

import com.jcabi.dynamo.Table; //导入依赖的package包/类
@Override
public Table table() {
    return new MkTable(this.data, this.tbl);
}
 
开发者ID:jcabi,项目名称:jcabi-dynamo,代码行数:5,代码来源:MkFrame.java


示例8: table

import com.jcabi.dynamo.Table; //导入依赖的package包/类
@Override
public Table table(final String name) {
    return new MkTable(this.data, name);
}
 
开发者ID:jcabi,项目名称:jcabi-dynamo,代码行数:5,代码来源:MkRegion.java


示例9: table

import com.jcabi.dynamo.Table; //导入依赖的package包/类
@Override
@RetryOnFailure(verbose = false, delay = Tv.FIVE, unit = TimeUnit.SECONDS)
public Table table(final String name) {
    return new ReTable(this.origin.table(name));
}
 
开发者ID:jcabi,项目名称:jcabi-dynamo,代码行数:6,代码来源:ReRegion.java


示例10: table

import com.jcabi.dynamo.Table; //导入依赖的package包/类
@Override
@RetryOnFailure(verbose = false, delay = Tv.FIVE, unit = TimeUnit.SECONDS)
public Table table() {
    return new ReTable(this.origin.table());
}
 
开发者ID:jcabi,项目名称:jcabi-dynamo,代码行数:6,代码来源:ReFrame.java


示例11: table

import com.jcabi.dynamo.Table; //导入依赖的package包/类
/**
 * Table to work with.
 * @return Table
 */
private Table table() {
    return this.region.table("targets");
}
 
开发者ID:yegor256,项目名称:rehttp,代码行数:8,代码来源:DyStatus.java


示例12: table

import com.jcabi.dynamo.Table; //导入依赖的package包/类
/**
 * Table to work with.
 * @return Table
 */
private Table table() {
    return this.region.table("scripts");
}
 
开发者ID:yegor256,项目名称:threecopies,代码行数:8,代码来源:DyBase.java


示例13: Sigmas

import com.jcabi.dynamo.Table; //导入依赖的package包/类
/**
 * Ctor.
 * @param tbl Table
 */
Sigmas(final Table tbl) {
    this.table = tbl;
}
 
开发者ID:yegor256,项目名称:jpeek,代码行数:8,代码来源:Sigmas.java


示例14: Mistakes

import com.jcabi.dynamo.Table; //导入依赖的package包/类
/**
 * Ctor.
 * @param tbl Table
 */
Mistakes(final Table tbl) {
    this.table = tbl;
}
 
开发者ID:yegor256,项目名称:jpeek,代码行数:8,代码来源:Mistakes.java


示例15: Results

import com.jcabi.dynamo.Table; //导入依赖的package包/类
/**
 * Ctor.
 * @param tbl Table
 */
Results(final Table tbl) {
    this.table = tbl;
}
 
开发者ID:yegor256,项目名称:jpeek,代码行数:8,代码来源:Results.java


示例16: table

import com.jcabi.dynamo.Table; //导入依赖的package包/类
/**
 * Table to work with.
 * @return Table
 */
private Table table() {
    return this.region.table("domains");
}
 
开发者ID:yegor256,项目名称:jare,代码行数:8,代码来源:DyUser.java


示例17: table

import com.jcabi.dynamo.Table; //导入依赖的package包/类
/**
 * Table to work with.
 * @return Table
 */
private Table table() {
    return this.region.table("vault");
}
 
开发者ID:yegor256,项目名称:wring,代码行数:8,代码来源:DyVault.java


示例18: table

import com.jcabi.dynamo.Table; //导入依赖的package包/类
/**
 * Table to work with.
 * @return Table
 */
private Table table() {
    return this.region.table("pipes");
}
 
开发者ID:yegor256,项目名称:wring,代码行数:8,代码来源:DyPipes.java


示例19: table

import com.jcabi.dynamo.Table; //导入依赖的package包/类
/**
 * Table to work with.
 * @return Table
 */
private Table table() {
    return this.region.table("events");
}
 
开发者ID:yegor256,项目名称:wring,代码行数:8,代码来源:DyEvents.java


示例20: ReTable

import com.jcabi.dynamo.Table; //导入依赖的package包/类
/**
 * Public ctor.
 * @param table Origin table
 */
public ReTable(final Table table) {
    this.origin = table;
}
 
开发者ID:jcabi,项目名称:jcabi-dynamo,代码行数:8,代码来源:ReTable.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java Style类代码示例发布时间:2022-05-22
下一篇:
Java BucketSizeInfo类代码示例发布时间: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