Enviar pesquisa
Carregar
20081128 Bp Study#15 Active Record
•
0 gostou
•
888 visualizações
Tomohito Ozaki
Seguir
Tecnologia
Denunciar
Compartilhar
Denunciar
Compartilhar
1 de 24
Baixar agora
Baixar para ler offline
Recomendados
Chicago Nightclub Concepts
Chicago Nightclub Concepts
J Michael Kilpatrick
Ruby on Rails Tutorial Part I
Ruby on Rails Tutorial Part I
Wei Jen Lu
Enquête ETI (2012)
Enquête ETI (2012)
PwC France
SBC Group R&D Tax Credit
SBC Group R&D Tax Credit
sbcgroup
Ruby Robots
Ruby Robots
Daniel Cukier
INSTALACION DE PERFILES PCF DE VPN CISCO EN AMBIENTE LINUX UBUNTU 13
INSTALACION DE PERFILES PCF DE VPN CISCO EN AMBIENTE LINUX UBUNTU 13
ROBERTO GARCIA HERNANDEZ
The Good Gym New Blood Brief
The Good Gym New Blood Brief
g00dfornothing
Chinese
Chinese
1234bateman
Recomendados
Chicago Nightclub Concepts
Chicago Nightclub Concepts
J Michael Kilpatrick
Ruby on Rails Tutorial Part I
Ruby on Rails Tutorial Part I
Wei Jen Lu
Enquête ETI (2012)
Enquête ETI (2012)
PwC France
SBC Group R&D Tax Credit
SBC Group R&D Tax Credit
sbcgroup
Ruby Robots
Ruby Robots
Daniel Cukier
INSTALACION DE PERFILES PCF DE VPN CISCO EN AMBIENTE LINUX UBUNTU 13
INSTALACION DE PERFILES PCF DE VPN CISCO EN AMBIENTE LINUX UBUNTU 13
ROBERTO GARCIA HERNANDEZ
The Good Gym New Blood Brief
The Good Gym New Blood Brief
g00dfornothing
Chinese
Chinese
1234bateman
20090911 Seasar Conference2009 Autumn
20090911 Seasar Conference2009 Autumn
Tomohito Ozaki
20090622 Bp Study#22
20090622 Bp Study#22
Tomohito Ozaki
java-ja 第1回 チキチキ『( ゜ェ゜)・;’.、ゴフッ』 - Visitor
java-ja 第1回 チキチキ『( ゜ェ゜)・;’.、ゴフッ』 - Visitor
Tomohito Ozaki
20091008 Jjug Ccc 2009fall
20091008 Jjug Ccc 2009fall
Tomohito Ozaki
これまでのScala これからのScala (20100904 Scala座#01 )
これまでのScala これからのScala (20100904 Scala座#01 )
Tomohito Ozaki
java-ja 第1回 チキチキ『( ゜ェ゜)・;’.、ゴフッ』 - Interpreter
java-ja 第1回 チキチキ『( ゜ェ゜)・;’.、ゴフッ』 - Interpreter
Tomohito Ozaki
20120804 ll decade lt_yuroyoro
20120804 ll decade lt_yuroyoro
Tomohito Ozaki
20090418 イケテルRails勉強会 第1部Rails編
20090418 イケテルRails勉強会 第1部Rails編
mochiko AsTech
Chinaonrails Rubyonrails21 Zh
Chinaonrails Rubyonrails21 Zh
Jesse Cai
Ruby on Rails 2.1 What's New Chinese Version
Ruby on Rails 2.1 What's New Chinese Version
Libin Pan
技術トレンディセミナー フレームワークとしてのTrac
技術トレンディセミナー フレームワークとしてのTrac
terada
T1
T1
TH Schee
Sc2009autumn 次世代Daoフレームワーク Doma
Sc2009autumn 次世代Daoフレームワーク Doma
Toshihiro Nakamura
【12-D-6】 Silverlight によるハイグレードなLOB/BI実現のためのコンポーネント活用法
【12-D-6】 Silverlight によるハイグレードなLOB/BI実現のためのコンポーネント活用法
devsumi2009
スケールするiPhone/Smart Phoneビジネス
スケールするiPhone/Smart Phoneビジネス
Shinichi Takamiya
Grails紹介
Grails紹介
Uehara Junji
Gorm @ gopher china
Gorm @ gopher china
Jinzhu
Web應用程式以及資安問題的探討
Web應用程式以及資安問題的探討
Mu Chun Wang
Cloud era -『クラウド時代』マッシュアップ技術による地方からの世界発信
Cloud era -『クラウド時代』マッシュアップ技術による地方からの世界発信
Yusuke Kawasaki
【13-A-2】 「Delphi for PHP のエバンジェリストが、日本の PHP エバンジェリストと、 PHP と IDE の今と未来を語る」~Em...
【13-A-2】 「Delphi for PHP のエバンジェリストが、日本の PHP エバンジェリストと、 PHP と IDE の今と未来を語る」~Em...
devsumi2009
Dev004奚江華
Dev004奚江華
Chui-Wen Chiu
20090313 Cakephpstudy
20090313 Cakephpstudy
Yusuke Ando
Mais conteúdo relacionado
Destaque
20090911 Seasar Conference2009 Autumn
20090911 Seasar Conference2009 Autumn
Tomohito Ozaki
20090622 Bp Study#22
20090622 Bp Study#22
Tomohito Ozaki
java-ja 第1回 チキチキ『( ゜ェ゜)・;’.、ゴフッ』 - Visitor
java-ja 第1回 チキチキ『( ゜ェ゜)・;’.、ゴフッ』 - Visitor
Tomohito Ozaki
20091008 Jjug Ccc 2009fall
20091008 Jjug Ccc 2009fall
Tomohito Ozaki
これまでのScala これからのScala (20100904 Scala座#01 )
これまでのScala これからのScala (20100904 Scala座#01 )
Tomohito Ozaki
java-ja 第1回 チキチキ『( ゜ェ゜)・;’.、ゴフッ』 - Interpreter
java-ja 第1回 チキチキ『( ゜ェ゜)・;’.、ゴフッ』 - Interpreter
Tomohito Ozaki
20120804 ll decade lt_yuroyoro
20120804 ll decade lt_yuroyoro
Tomohito Ozaki
Destaque
(7)
20090911 Seasar Conference2009 Autumn
20090911 Seasar Conference2009 Autumn
20090622 Bp Study#22
20090622 Bp Study#22
java-ja 第1回 チキチキ『( ゜ェ゜)・;’.、ゴフッ』 - Visitor
java-ja 第1回 チキチキ『( ゜ェ゜)・;’.、ゴフッ』 - Visitor
20091008 Jjug Ccc 2009fall
20091008 Jjug Ccc 2009fall
これまでのScala これからのScala (20100904 Scala座#01 )
これまでのScala これからのScala (20100904 Scala座#01 )
java-ja 第1回 チキチキ『( ゜ェ゜)・;’.、ゴフッ』 - Interpreter
java-ja 第1回 チキチキ『( ゜ェ゜)・;’.、ゴフッ』 - Interpreter
20120804 ll decade lt_yuroyoro
20120804 ll decade lt_yuroyoro
Semelhante a 20081128 Bp Study#15 Active Record
20090418 イケテルRails勉強会 第1部Rails編
20090418 イケテルRails勉強会 第1部Rails編
mochiko AsTech
Chinaonrails Rubyonrails21 Zh
Chinaonrails Rubyonrails21 Zh
Jesse Cai
Ruby on Rails 2.1 What's New Chinese Version
Ruby on Rails 2.1 What's New Chinese Version
Libin Pan
技術トレンディセミナー フレームワークとしてのTrac
技術トレンディセミナー フレームワークとしてのTrac
terada
T1
T1
TH Schee
Sc2009autumn 次世代Daoフレームワーク Doma
Sc2009autumn 次世代Daoフレームワーク Doma
Toshihiro Nakamura
【12-D-6】 Silverlight によるハイグレードなLOB/BI実現のためのコンポーネント活用法
【12-D-6】 Silverlight によるハイグレードなLOB/BI実現のためのコンポーネント活用法
devsumi2009
スケールするiPhone/Smart Phoneビジネス
スケールするiPhone/Smart Phoneビジネス
Shinichi Takamiya
Grails紹介
Grails紹介
Uehara Junji
Gorm @ gopher china
Gorm @ gopher china
Jinzhu
Web應用程式以及資安問題的探討
Web應用程式以及資安問題的探討
Mu Chun Wang
Cloud era -『クラウド時代』マッシュアップ技術による地方からの世界発信
Cloud era -『クラウド時代』マッシュアップ技術による地方からの世界発信
Yusuke Kawasaki
【13-A-2】 「Delphi for PHP のエバンジェリストが、日本の PHP エバンジェリストと、 PHP と IDE の今と未来を語る」~Em...
【13-A-2】 「Delphi for PHP のエバンジェリストが、日本の PHP エバンジェリストと、 PHP と IDE の今と未来を語る」~Em...
devsumi2009
Dev004奚江華
Dev004奚江華
Chui-Wen Chiu
20090313 Cakephpstudy
20090313 Cakephpstudy
Yusuke Ando
Tcl/Tk+ハッシュリスト
Tcl/Tk+ハッシュリスト
Hiromu Shioya
Shibuya.abc - Gnashで遊ぼう
Shibuya.abc - Gnashで遊ぼう
gyuque
object-shapes
object-shapes
Hajime Morrita
【12-B-4】 並列処理開発を支援するコンパイラの機能
【12-B-4】 並列処理開発を支援するコンパイラの機能
devsumi2009
Itpub电子杂志(第二期)
Itpub电子杂志(第二期)
yiditushe
Semelhante a 20081128 Bp Study#15 Active Record
(20)
20090418 イケテルRails勉強会 第1部Rails編
20090418 イケテルRails勉強会 第1部Rails編
Chinaonrails Rubyonrails21 Zh
Chinaonrails Rubyonrails21 Zh
Ruby on Rails 2.1 What's New Chinese Version
Ruby on Rails 2.1 What's New Chinese Version
技術トレンディセミナー フレームワークとしてのTrac
技術トレンディセミナー フレームワークとしてのTrac
T1
T1
Sc2009autumn 次世代Daoフレームワーク Doma
Sc2009autumn 次世代Daoフレームワーク Doma
【12-D-6】 Silverlight によるハイグレードなLOB/BI実現のためのコンポーネント活用法
【12-D-6】 Silverlight によるハイグレードなLOB/BI実現のためのコンポーネント活用法
スケールするiPhone/Smart Phoneビジネス
スケールするiPhone/Smart Phoneビジネス
Grails紹介
Grails紹介
Gorm @ gopher china
Gorm @ gopher china
Web應用程式以及資安問題的探討
Web應用程式以及資安問題的探討
Cloud era -『クラウド時代』マッシュアップ技術による地方からの世界発信
Cloud era -『クラウド時代』マッシュアップ技術による地方からの世界発信
【13-A-2】 「Delphi for PHP のエバンジェリストが、日本の PHP エバンジェリストと、 PHP と IDE の今と未来を語る」~Em...
【13-A-2】 「Delphi for PHP のエバンジェリストが、日本の PHP エバンジェリストと、 PHP と IDE の今と未来を語る」~Em...
Dev004奚江華
Dev004奚江華
20090313 Cakephpstudy
20090313 Cakephpstudy
Tcl/Tk+ハッシュリスト
Tcl/Tk+ハッシュリスト
Shibuya.abc - Gnashで遊ぼう
Shibuya.abc - Gnashで遊ぼう
object-shapes
object-shapes
【12-B-4】 並列処理開発を支援するコンパイラの機能
【12-B-4】 並列処理開発を支援するコンパイラの機能
Itpub电子杂志(第二期)
Itpub电子杂志(第二期)
Último
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
Delhi Call girls
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
V3cube
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Igalia
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
Malak Abu Hammad
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
hans926745
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
Paola De la Torre
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
Slack Application Development 101 Slides
Slack Application Development 101 Slides
praypatel2
🐬 The future of MySQL is Postgres 🐘
🐬 The future of MySQL is Postgres 🐘
RTylerCroy
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
The Digital Insurer
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
Principled Technologies
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
Delhi Call girls
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Miguel Araújo
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
apidays
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
Pooja Nehwal
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Neo4j
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
Sinan KOZAK
Último
(20)
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Slack Application Development 101 Slides
Slack Application Development 101 Slides
🐬 The future of MySQL is Postgres 🐘
🐬 The future of MySQL is Postgres 🐘
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
20081128 Bp Study#15 Active Record
1.
BP Study #15
ORマッパー対決〜2008 Active Recordとか
2.
自己紹介 •
尾崎 智仁 • ID:yuroyoro • フリーエンジニア • Java、最近はScala
3.
Blog
4.
ORマッパー
対決 ってことで
5.
6.
7.
8.
Active Record
9.
ActiveRecordって? •RailsでのO/R Mapper •Railsなくてもつかえるけど •ActiveRecordパターン •Mapping定義が簡単 •class Member
< ActiveRecord::Base
10.
ActiveRecordって? •DDL関係はMigrationで •Act_as_*で振る舞いを拡張可能 •動的ファインダ •Lazy Loading •Named Scope
->イカス
11.
やってみよう!
12.
ActiveRecordを使う準備 •MySqlをインストールしておく •MySqlにDatabaseを作っておく •Railsアプリを生成する •Migration書く
13.
ActiveRecordを使う - 1 Railアプリを生成
$ rails ARTest create create app/controllers create app/helpers create app/models create app/views/layouts create config/environments create config/initializers create db create doc
14.
ActiveRecordを使う - 2 Modelを生成する
$ ./script/generate model member username:string password:string ¥ sex:decimal birthday:datetime last_login_time:timestamp :0:Warning: Gem::SourceIndex#search support for Regexp patterns is deprecated exists app/models/ exists test/unit/ exists test/fixtures/ create app/models/member.rb create test/unit/member_test.rb create test/fixtures/members.yml create db/migrate create db/migrate/20081127123415_create_members.rb
15.
ActiveRecordを使う - 3 Migrateする
$ rake db:migrate (in /Users/ozaki/dev/Project/sandbox/work/ARTest) == 20081127123415 CreateMembers: migrating ==================================== -- create_table(:members) -> 0.0049s == 20081127123415 CreateMembers: migrated (0.0054s) ===========================
16.
ActiveRecordを使う - 4 Consoleで確認
$ script/console Loading development environment (Rails 2.1.0) >> member=Member.find(:all) => [] >> Member.create #<Member id: 1, username: nil, password: nil, first_name: nil, last_name: nil, sex: nil, birthday: nil, last_login_time: nil, created_at: quot;2008-11-27 13:16:47quot;, updated_at: quot;2008-11-27 13:16:47quot;> >> Member.find(1) => #<Member id: 1, username: nil, password: nil, first_name: nil, last_name: nil, sex: nil, birthday: nil, last_login_time: nil, created_at: quot;2008-11-27 13:16:47quot;, updated_at: quot;2008-11-27 13:16:47”>
17.
ActiveRecordを使う - 5 動的な属性ベースのファインダ
>> Member.find_by_username('Test2') => #<Member id: 2, username: quot;Test2quot;, password: nil, first_name: nil, last_name: nil, sex: nil, birthday: nil, last_login_time: nil, created_at: quot;2008-11-27 13:17:04quot;, updated_at: quot;2008-11- 27 13:21:14quot;>
18.
ActiveRecordを使う - 6 関連の設定
class Employee< ActiveRecord::Base belongs_to :department has_many :roles ,:through => :belongs End class Department< ActiveRecord::Base has_many :employees acts_as_tree :order => quot;idquot; end
19.
ActiveRecordを使う - 7 Named_scope
class Member < ActiveRecord::Base named_scope :male, :conditions=>[quot;sex = ?quot;,1] named_scope :recent, lambda {|*args| {:conditions => [quot;updated_at > ?quot;, args.first || 1.day.ago]} } end
20.
ActiveRecord まとめ よかったさがし •Mapping定義は楽 •Pluginいっぱい •Lazy Loading •Irb上で簡単確認
21.
ActiveRecord まとめ Disってみる Disってみる •リファクタリング大変 •Migrationは計画的に •IDEの補完が… •Joinとかにがて
22.
おまけ Active Objects
23.
ActiveObjectsって? •ARパターンのJava実装 •Interfaceにgetter/setterで •manager.migrate(Person.class); •EntityManager •アノテーション •http://d.hatena.ne.jp/nattou_cur ry_2/
24.
ご清聴 ありがとう ございました
Baixar agora