Following Arin’s specification the Comments Column Family is going to look like this
Comments: { Blog-Slug:{ Time_UUID_1:{ Coment: A Comment, Email: andy@abc.com }, Time_UUID_2:{ Coment: A Comment, Email: andy@abc.com } } }
Lets be clear Blog-Slug will be the Slug entry for the blog that is being commented on. This is the key we will be looking for. Under that are the supercolumn entries, with a key of type UUID. This contains a number of columns that are the entries for the comments. So to add a comment we can do this:
Keyspace ks = client.getKeyspace("BloggyAppy"); ColumnPath cp = new ColumnPath("Comments"); java.util.UUID timeUUID=getTimeUUID(); cp.setSuper_column(asByteArray(timeUUID)); cp.setColumn(bytes("email")); ks.insert(slugValue, cp, bytes("andy@abc.com")); cp.setColumn(bytes("Comment")); ks.insert(slugValue, cp, bytes("AComment"));
SlugValue is essentially the title. Note that getTimeUUID is defined as:
public static java.util.UUID getTimeUUID() { return java.util.UUID.fromString(new com.eaio.uuid.UUID().toString()); }
Awesome information. I am really surprised with this topic. Keep up the good work and post more here to read.
ReplyDeleteケムサーチ
Thanks for the informative and useful information shared on the blog. I really enjoyed reading the article. Low Cost Website Design Company
DeleteNice to be visiting your blog again, it has been months for me. Well this article that i've been waited for so long. I need this article to complete my assignment in the college, and it has same topic with your article. Thanks, great share.
ReplyDeletecommercial trash receptacles
Thanks so much with this fantastic new web site. I'm very fired up to show it to anyone. It makes me so satisfied your vast understanding and wisdom have a new channel on the world.
ReplyDeleteI feel really happy to have seen your webpage and look forward to so many more entertaining times reading here. Thanks once more for all the details.
ReplyDeleteRead More: App development Company
Mobial App development Company
Excellent article. Very interesting to read. I really love to read such a nice article. Thanks! keep rocking. Web development belize
ReplyDeleteNice post this one is, thanks for sharing this information with us.
ReplyDeleteShopify Development Company
I in actuality value this blog to have such sort of instructive learning.Best Website Development Company in Kanpur
ReplyDelete