- 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
ならば、システムに存在するCustomer
EntityたちをCollectionに保持するかのように振舞う。 - PoEAAにもある。参照
- もちろん本当のCollectionに保持したら大変なことになるので、バックエンドではデータベースアクセスが行われたりするわけだが、そういったことを抽象化する。
This file contains 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
function convertWithLang(timeAgo, lang) { | |
if (lang == "ja") | |
return toJa(timeAgo); | |
return timeAgo; | |
} | |
function convert(timeAgo, dict, strip) { | |
var delim = " "; | |
var arr = timeAgo.split(delim); |
This file contains 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/sh | |
#ID='A16FF353-8441-459E-A50C-B071F53F51B7' # Xcode 6.2 | |
ID='992275C1-432A-4CF7-B659-D84ED6D42D3F' # Xcode 6.3 | |
PLIST_BUDDY=/usr/libexec/PlistBuddy | |
function add_compatibility() { | |
"$PLIST_BUDDY" -c "Add DVTPlugInCompatibilityUUIDs:10 string $2" \ | |
"$1/Contents/Info.plist" |
This file contains 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
// | |
// SlideAnimatedTransitioning.h | |
// SwipeLeft | |
// | |
// Created by Visnu on 4/14/14. | |
// Copyright (c) 2014 Visnu Pitiyanuvath. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> |
This file contains 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
defmodule Http2StudyClient do | |
@moduledoc """ | |
http2study | |
""" | |
@doc "GET HTTP/2.0" | |
def get domain, port do | |
{:ok, sock} = :gen_tcp.connect domain, port, [:binary, {:packet, 0}] | |
try do | |
{:ok, data} = send_connection_preface sock |
This file contains 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
func encode<T>(var value: T) -> NSData { | |
return withUnsafePointer(&value) { p in | |
NSData(bytes: p, length: sizeofValue(value)) | |
} | |
} | |
func decode<T>(data: NSData) -> T { | |
let pointer = UnsafeMutablePointer<T>.alloc(sizeof(T.Type)) | |
data.getBytes(pointer) | |
This file contains 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
// | |
// Device.swift | |
// imHome | |
// | |
// Created by Kevin Xu on 2/9/15. Updated on 6/20/15. | |
// Copyright (c) 2015 Alpha Labs, Inc. All rights reserved. | |
// | |
import Foundation |
This file contains 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 Cocoa | |
import MASShortcut | |
func pow() { | |
let rect = NSScreen.mainScreen()?.frame | |
let window = NSWindow(contentRect: rect!, styleMask: NSBorderlessWindowMask, backing: .Buffered, `defer`: false) | |
window.backgroundColor = NSColor.clearColor() | |
window.opaque = false | |
window.alphaValue = 1 | |
window.makeKeyAndOrderFront(NSApplication.sharedApplication()) |
This file contains 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
# VERSION 1.0.4 | |
# Author: @madhavajay | |
# This currently works for iOS and watchOS in the Simulator and Devices | |
# Changes | |
# Using ${TOOLCHAIN} in two places now | |
# Added double quotes " around paths | |
# Fixed watchOS Issues | |
# Instructions iOS |
OlderNewer