您的位置:首页 > 产品设计 > UI/UE

play 集成squeryl ORM持久化框架

2015-11-07 11:05 513 查看

Therecommendedversionis0.9.5-6

SupportedScalaversionsare2.10.0,2.9.2,2.9.1,2.9.0,2.8.1and2.8.0

SBT

AfterhavingsetupyourprojecttouseSBT(see
howtosetupSBT)

DeclaretheSqueryldependencyintheSBTprojectdefiniition

01
libraryDependencies++
=

Seq(
02
"org.squeryl"

%%
"squeryl"
%
"0.9.5-6"
,
03
yourDatabaseDependency
04
)
05
06
//yourDatabaseDependencyisoneofthesupporteddatabases:
07
08
val
h
2

=
"com.h2database"
%
"h2"
%
"1.2.127"
09
val
mysqlDriver
=
"mysql"
%
"mysql-connector-java"
%
"5.1.10"
10
val
posgresDriver
=
"postgresql"
%
"postgresql"
%
"8.4-701.jdbc4"
11
val
msSqlDriver
=
"net.sourceforge.jtds"

%
"jtds"
%
"1.2.4"
12
val
derbyDriver
=
"org.apache.derby"

%
"derby"
%
"10.7.1.1"
Note:TheOracledriverisnotavailablevia
SBT/Maven,youwillhavetodownloadedmanually.

Theremainingstepsare:

Bootstrapthesessionfactory
Define,andinitialiseaschema

Youshouldnowbereadytoinsert,update,deletedata,andofcourserunqueries.

Manualdependencymanagement

IfyouwanttomanageyourdependencieswithoutSBTorMaven,youwillneedthefollowingjars:

TheScalaruntimejar,version2.10.0,2.9.2,2.9.1(or2.9.0,2.8.1,2.8.0)
TheSqueryljarfound
here
TheCGLIBcglib-nodep-2.2.jar,found
here
AJDBCdriverforyourdatabase,see
supporteddatabases
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: