← Overview | Circumflex ORM Documentation | Central Abstractions → |
If you use Maven for building your project, add following lines to pom.xml
(or merge XML sections accordingly):
<properties>
<cx.version><!-- desired version --></cx.version>
</properties>
<dependencies>
<dependency>
<groupId>ru.circumflex</groupId>
<artifactId>circumflex-orm</artifactId>
<version>${cx.version}</version>
</dependency>
</dependencies>
If you prefer SBT, make sure that libraryDependencies
of your project contains following artifact:
"ru.circumflex" % "circumflex-orm" % cxVersion % "compile->default"
where cxVersion
points to desired Circumflex version. Here's the sample project configuration:
import sbt._
class MyProject(info: ProjectInfo) extends DefaultProject(info) {
val cxVersion = "2.0"
override def libraryDependencies = Set(
"ru.circumflex" % "circumflex-orm" % cxVersion % "compile->default"
) ++ super.libraryDependencies
}
You can follow SBT Setup Guide to create a new project.
Note that first-time builds usually require a substantial amount of dependencies downloads.
Configure database access by specifying following configuration parameters:
orm.connection.driver
— fully-qualified class name of JDBC Driver of your database vendor;orm.connection.url
— URL for database communication (read the documentation of your database vendor for more information);orm.connection.username
and orm.connection.password
— database account data which will be used to obtain JDBC connections.Here's the example cx.properties
file:
orm.connection.driver=org.postgresql.Driver
orm.connection.url=jdbc:postgresql://localhost:5432/mydb
orm.connection.username=myuser
orm.connection.password=mypassword
Please refer to Circumflex Configuration API for more information on how to configure your application.
All code examples assume that you have following import
statement in code where necessary:
import ru.circumflex.orm._
← Overview | Circumflex ORM Documentation | Central Abstractions → |