dbx-core

A transaction management library for `Scala` users, migrated from `Spring Framework`.

License

License

GroupId

GroupId

com.lingcreative
ArtifactId

ArtifactId

dbx-core_2.12
Last Version

Last Version

2.1.2
Release Date

Release Date

Type

Type

jar
Description

Description

dbx-core
A transaction management library for `Scala` users, migrated from `Spring Framework`.
Project URL

Project URL

https://github.com/sauntor/dbx
Project Organization

Project Organization

LingCreative Studio
Source Code Management

Source Code Management

https://github.com/sauntor/dbx

Download dbx-core_2.12

How to add to project

<!-- https://jarcasting.com/artifacts/com.lingcreative/dbx-core_2.12/ -->
<dependency>
    <groupId>com.lingcreative</groupId>
    <artifactId>dbx-core_2.12</artifactId>
    <version>2.1.2</version>
</dependency>
// https://jarcasting.com/artifacts/com.lingcreative/dbx-core_2.12/
implementation 'com.lingcreative:dbx-core_2.12:2.1.2'
// https://jarcasting.com/artifacts/com.lingcreative/dbx-core_2.12/
implementation ("com.lingcreative:dbx-core_2.12:2.1.2")
'com.lingcreative:dbx-core_2.12:jar:2.1.2'
<dependency org="com.lingcreative" name="dbx-core_2.12" rev="2.1.2">
  <artifact name="dbx-core_2.12" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.lingcreative', module='dbx-core_2.12', version='2.1.2')
)
libraryDependencies += "com.lingcreative" % "dbx-core_2.12" % "2.1.2"
[com.lingcreative/dbx-core_2.12 "2.1.2"]

Dependencies

compile (2)

Group / Artifact Type Version
com.typesafe : config jar 1.3.3
org.slf4j : slf4j-api jar 1.7.25

Project Modules

There are no modules declared in this project.

DBX

A transaction management library for Scala users, migrated from Spring Framework.

Usage

Add Dependencies

// Core library
libraryDependencies += "com.lingcreative" %% "dbx-core" % "2.1.0"

// for Anorm users
libraryDependencies += "com.lingcreative" %% "dbx-anorm" % "2.1.0"

Play with Dbx

Core library usage
import dbx.api._

object PersistenceSupport extends DatabaseComponents {

  // replace `DataSource` with the really implementation you use
  override lazy val dataSource = new DataSource(username, passwd, url)

}

class UsersDAO(transactional: Transactional[Connection]) {
  def findAll() = transactional() { connection =>
    val resultSet = connection.createStatement().executeQuery("SELECT * FROM users")
    extractUsers(resultSet)
  }
}
Anorm library usage

See SQLFactorySpecs, PackageSpecs

Default Configuration

dbx {
  resources = [ default ]
  default {
    resource = default
    readOnly = false
    isolation = DEFAULT
    propagation = REQUIRED
    timeout = -1
    noRollbackFor = []
    rollbackFor += java.lang.RuntimeException
    rollbackFor += java.lang.Error
  }
}

Versions

Version
2.1.2
2.1.1
2.1.0
2.0.0