Popularity
1.3
Stable
Activity
0.0
Stable
11
1
4
Programming language: Scala
Tags:
Database
Latest version: v1.0.0
MapperDao alternatives and similar packages
Based on the "Database" category.
Alternatively, view MapperDao alternatives based on common mentions on social networks and blogs.
-
Slick
Slick (Scala Language Integrated Connection Kit) is a modern database query and access library for Scala -
Elastic4s
Elasticsearch Scala Client - Reactive, Non Blocking, Type Safe, HTTP Client -
PostgreSQL and MySQL async
Async database drivers to talk to PostgreSQL and MySQL in Scala. -
ScalikeJDBC
A tidy SQL-based DB access library for Scala developers. This library naturally wraps JDBC APIs and provides you easy-to-use APIs. -
scala-redis
A scala library for connecting to a redis server, or a cluster of redis nodes using consistent hashing on the client side. -
Phantom
Schema safe, type-safe, reactive Scala driver for Cassandra/Datastax Enterprise -
ReactiveMongo
:leaves: Non-blocking, Reactive MongoDB Driver for Scala -
rediscala
Non-blocking, Reactive Redis driver for Scala (with Sentinel support) -
Squeryl
A Scala DSL for talking with databases with minimum verbosity and maximum type safety -
SwayDB
Persistent and in-memory key-value storage engine for JVM that scales on a single machine. -
Pulsar4s
Idiomatic, typesafe, and reactive Scala client for Apache Pulsar -
scredis
Non-blocking, ultra-fast Scala Redis client built on top of Akka IO, used in production at Livestream -
Scala-Forklift
Type-safe data migration tool for Slick, Git and beyond. -
AnormCypher
Neo4j Scala library based on Anorm in the Play Framework -
Scruid
Scala + Druid: Scruid. A library that allows you to compose queries in Scala, and parse the result back into typesafe classes. -
Clickhouse-scala-client
Clickhouse Scala Client with Reactive Streams support -
Tepkin
Reactive MongoDB Driver for Scala built on top of Akka IO and Akka Streams. -
Couchbase
The Couchbase Monorepo for JVM Clients: Java, Scala, io-core⦠-
ScalaRelational
Type-Safe framework for defining, modifying, and querying SQL databases -
lucene4s
Light-weight convenience wrapper around Lucene to simplify complex tasks and add Scala sugar. -
ReactiveNeo
[DISCONTINUED] Reactive type-safe Scala driver for Neo4J -
GCP Datastore Akka Persistence Plugin
akka-persistence-gcp-datastore is a journal and snapshot store plugin for akka-persistence using google cloud firestore in datastore mode.
Static code analysis for 29 languages.
Your projects are multi-language. So is SonarQube analysis. Find Bugs, Vulnerabilities, Security Hotspots, and Code Smells so you can release quality code every time. Get started analyzing your projects today for free.
Promo
www.sonarqube.org
Do you think we are missing an alternative of MapperDao or a related project?
README
Summary
MapperDao is an ORM library for the scala language and the following databases:
- oracle
- postgresql
- mysql
- derby
- sql server
- h2
It allows [...(more)](wiki/Summary.md)
News
- 28/12/2016 : 1.0.2 for scala 2.11 and 2.12 is released.
- 05/04/2015 : moved the project to github.
- 25/08/2014 : updated the [tutorial](documentation/tutorial.pdf)
- 08/06/2014 : 1.0.1 for scala 2.10 & 2.11 is available, a maintenance release. The artifactId now complies with sbt rules reg. scala version. Also minor clean up of the exposed API and code.
- 21/04/2014 : 1.0.0.2.11 is now released for scala 2.11 .
- 20/04/2014 : 1.0.0.2.10 is now released for scala 2.10 .
- 18/01/2014 : 1.0.0.2.10.3-SNAPSHOT with immutable query DSL, better [aliasing](wiki/QueryAlias.md) and [immutable builder](wiki/DynamicQueries.md)
[...(more)](wiki/News.md)
Quick Links
[mapperdao tutorial (pdf)](documentation/tutorial.pdf)
[Documentation](wiki/TableOfContents.md)
[Sbt/Maven Configuration](wiki/MavenConfiguration.md)
[F.A.Q.](wiki/FAQ.md)
Example
import java.util.Properties
import org.apache.commons.dbcp.BasicDataSourceFactory
// create a datasource using apache dbcp
val properties = new Properties
properties.load(getClass.getResourceAsStream("/jdbc.test.properties"))
val dataSource = BasicDataSourceFactory.createDataSource(properties)
// create the mapperdao instance, connect to an oracle database and register our 2 entities
import com.googlecode.mapperdao.utils.Setup
val (jdbc,mapperDao,queryDao,txManager) = Setup.oracle(dataSource,List(PersonEntity,CompanyEntity))
// domain model classes (immutable)
class Person(val name: String, val company: Company)
class Company(val name: String)
// mappings (using default table and column naming convention)
object PersonEntity extends Entity[Int,SurrogateIntId, Person] {
val id = key("id") autogenerated (_.id)
val name = column("name") to (_.name)
val company = manytoone(CompanyEntity) to (_.company)
def constructor(implicit m) = new Person(name, company) with Stored {
val id: Int = PersonEntity.id
}
}
object CompanyEntity extends Entity[Int,SurrogateIntId, Company] {
val id = key("id") autogenerated (_.id)
val name = column("name") to (_.name)
def constructor(implicit m) = new Company(name) with Stored {
val id: Int = CompanyEntity.id
}
}
val tx = Transaction.get(txManager, Propagation.Nested, Isolation.ReadCommited, -1)
// insert a person
import mapperDao._
val person = new Person("Kostas", new Company("Coders limited"))
val inserted = tx { () => insert(PersonEntity, person) } // inserts person, company, in 1 transaction
// print the autogenerated id and the person name
println(s"${inserted.id} ${inserted.name}"))
// now update the company for this person
val company2 = insert(CompanyEntity, Company("Scala Inc"))
val modified = new Person(inserted.name, company2)
val updated = update(PersonEntity, inserted, modified) // no transaction here, but we could do the operation transactionally
// and select it from the database
val selected = select(PersonEntity, updated.id).get
// finally, delete the row
mapperDao.delete(PersonEntity, selected)
// run some queries
val pe=PersonEntity //alias
val people=query(select from pe) // get all
// people is a list of Person with IntId
// fetch only page 2 of all people
val people=query(QueryConfig.pagination(2, 10),select from pe)
// people is a list of Person with IntId
Roadmap
- sqlite driver
- optimistic locking
- sum, avg, min, max and for column mappings and groupby in mappings of statistical entities
MapperDao would like to thank
- YourKit is kindly supporting this open source project with its full-featured Java Profiler. YourKit, LLC is the creator of innovative and intelligent tools for profiling Java and .NET applications. Take a look at YourKit's leading software products: