Created
November 1, 2012 09:59
-
-
Save yangbajing/3992836 to your computer and use it in GitHub Desktop.
Squery Helpers squeryUsing(不需要事物的帮助方法)
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
| package com.teshengtech.persistence | |
| import org.squeryl.Session | |
| import org.squeryl.SessionFactory | |
| import org.squeryl.PrimitiveTypeMode._ | |
| trait SqueryHelpers { | |
| @inline | |
| def squerylUsing[R](func: => R): R = | |
| Session.currentSessionOption.map(using(_)(func)) | |
| .getOrElse(using(SessionFactory.newSession)(func)) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment