SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.
SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.
Successfully reported this slideshow.
Activate your 14 day free trial to unlock unlimited reading.
29.
class Book < AWS::Record::Base
string_attr :title
end
Book.new(:title => 'スベらないプレゼン').save
Book.where('title like ?', '%プレゼン%').count
$ rails generate scaffold_controller Book title:string
config/routes.rb:
Myapp::Application.routes.draw do
resources :books
end
http://aws.amazon.com/articles/8621639827664165 より
30.
class Book < AWS::Record::Base
string_attr :title
end
Book.new(:title => 'スベらないプレゼン').save
Railsと違和感なしに
Book.where('title like ?', '%プレゼン%').count
統合できる!
$ rails generate scaffold_controller Book title:string
config/routes.rb:
Myapp::Application.routes.draw do
resources :books
end
http://aws.amazon.com/articles/8621639827664165 より
34.
@DynamoDBTable(tableName = "BookTable")
public class Book {
private Long id;
private String title;
@DynamoDBHashKey
public Long getId() {
" return this.id;
}
@DynamoDBAttribute(attributeName = "title")
public String getTitle() {
" return this.title;
}
// 以下、setter
}
35.
使用例
(DynamoDBMapper)
AWSCredentials cred = new BasicAWSCredentials(
"アクセスキ", "シークレットキー");
AmazonDynamoDB db = new AmazonDynamoDBClient(cred);
DynamoDBMapper mapper = new DynamoDBMapper(db);
Long key = 105L;
Book book = mapper.load(Book.class, key);
book.setTitle("スベらないプレゼン");
mapper.save(book);
mapper.delete(book);
39.
@SimpleDBDomain(domainName = "BookDomain")
public class Book {
@SimpleDBItemName
public Long id;
@SimpleDBAttribute(attributeName = "title")
public String title;
}
40.
使用例
(SimpleDBMapper)
AWSCredentials cred = new BasicAWSCredentials(
"アクセスキ", "シークレットキー");
AmazonSimpleDB db = new AmazonSimpleDBClient(cred);
SimpleDBMapper mapper = new SimpleDBMapper(db);
Long key = 105L;
Book book = mapper.load(Book.class, key);
book.setTitle("スベらないプレゼン");
mapper.save(book);
mapper.delete(book);