- Spring DATA JPAは、Spring Frameworkの拡張ライブラリ。
springframework-jdbcシリーズかspringframework-ormシリーズのようだが、安定したら本流に組み込まれるのかもしれない。 - この記事の執筆時点のバージョンは SPRING DATA JPA 1.1.0 GA
- Spring DATA JPAは、JPAの機能をベースに 汎用的な Repositoryの機能を提供する。
- ちなみに、Repositoryというのは、ドメイン駆動設計(Domain Driven Design)のパターンのひとつで、ドメインのEntityのCollectionのように振舞う責務を持つ。例えば
CustomerRepositoryならば、システムに存在するCustomerEntityたちをCollectionに保持するかのように振舞う。 - PoEAAにもある。参照
- もちろん本当のCollectionに保持したら大変なことになるので、バックエンドではデータベースアクセスが行われたりするわけだが、そういったことを抽象化する。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.io.* | |
| import groovyx.net.http.HTTPBuilder | |
| import groovyx.net.http.EncoderRegistry | |
| import static groovyx.net.http.Method.* | |
| import static groovyx.net.http.ContentType.* | |
| buildscript { | |
| repositories { | |
| mavenCentral() |
- QueryDslは、Open Sourceのライブラリ。クエリを型安全で流れるようなインタフェースなDSL (Java内部DSL)で記述することができるライブラリで、JPAのCriteria APIに変換するDSLと、直接SQLに変換するDSLとがある。
- JPAの方については、QueryDslのBlog記事を見れば他にいうことはほとんどないので、この記事ではSQLの方について書く。
- この記事の執筆時点のバージョンはQueryDsl 2.7.2
- QueryDsl-SQLが提供する antタスク
com.mysema.query.sql.ant.AntMetaDataExporterを用いると、データベーススキーマから Java Beanとメタクラスを生成してくれる。今回は下記のようなリレーションをもつBeanを生成した前提の例である。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| vimdir=/usr/share/vim/vim74 | |
| mkdir -p $vimdir/{ftdetect,indent,syntax} | |
| for d in ftdetect indent syntax | |
| do | |
| curl -o $vimdir/$d/scala.vim https://raw.githubusercontent.com/scala/scala-tool-support/master/tool-support/vim/$d/scala.vim | |
| done | |
| for f in html javascript css vb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # powershell -executionPolicy unrestricted -command "ie.ps1" | |
| while($True) { | |
| #$shell = New-Object -COM WScript.Shell | |
| #$ie = $shell.CreateObject("InternetExplorer.Application") | |
| $ie = New-Object -Com InternetExplorer.Application | |
| echo "launching ie" | |
| $ie.navigate2("about:blank") | |
| sleep 1 | |
| $ie.visible=$true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| dir -Directory | % { $d = $_ | |
| move "$d\*" . | |
| rmdir $d | |
| } |
OlderNewer