domaframework / Doma
Licence: apache-2.0
DAO oriented database mapping framework for Java 8+
Stars: ✭ 257
Projects that are alternatives of or similar to Doma
Poli
An easy-to-use BI server built for SQL lovers. Power data analysis in SQL and gain faster business insights.
Stars: ✭ 1,850 (+619.84%)
Mutual labels: sql, jdbc
H2database
H2 is an embeddable RDBMS written in Java.
Stars: ✭ 3,078 (+1097.67%)
Mutual labels: sql, jdbc
Jplusone
Tool for automatic detection and asserting "N+1 SELECT problem" occurences in JPA based Spring Boot Java applications and finding origin of JPA issued SQL statements in general
Stars: ✭ 91 (-64.59%)
Mutual labels: sql, jdbc
Quickperf
QuickPerf is a testing library for Java to quickly evaluate and improve some performance-related properties
Stars: ✭ 231 (-10.12%)
Mutual labels: sql, jdbc
Fastsql
Database rapid development framework for Java(数据库快速开发框架).
Stars: ✭ 100 (-61.09%)
Mutual labels: sql, jdbc
Java Persistence Frameworks Comparison
Comparison of non-JPA SQL mapping frameworks for Java (Jooq, Spring JDBCTemplate, MyBatis, EBean, JDBI, Speedment, sql2o)
Stars: ✭ 213 (-17.12%)
Mutual labels: sql, jdbc
Db Util
If you are using JPA and Hibernate, this tool can auto-detect N+1 query issues during testing.
Stars: ✭ 194 (-24.51%)
Mutual labels: sql, jdbc
Jaydebeapi
JayDeBeApi module allows you to connect from Python code to databases using Java JDBC. It provides a Python DB-API v2.0 to that database.
Stars: ✭ 247 (-3.89%)
Mutual labels: sql, jdbc
Porsas
Experimental stuff for going fast with Clojure + JDBC & Async SQL
Stars: ✭ 78 (-69.65%)
Mutual labels: sql, jdbc
Linkis
Linkis helps easily connect to various back-end computation/storage engines(Spark, Python, TiDB...), exposes various interfaces(REST, JDBC, Java ...), with multi-tenancy, high performance, and resource control.
Stars: ✭ 2,323 (+803.89%)
Mutual labels: sql, jdbc
Jasync Sql
Java & Kotlin Async DataBase Driver for MySQL and PostgreSQL written in Kotlin
Stars: ✭ 1,092 (+324.9%)
Mutual labels: sql, jdbc
Sqlhelper
SQL Tools ( Dialect, Pagination, DDL dump, UrlParser, SqlStatementParser, WallFilter, BatchExecutor for Test) based Java. it is easy to integration into any ORM frameworks
Stars: ✭ 242 (-5.84%)
Mutual labels: sql, jdbc
Doma
Doma 2 is a database access framework for Java 8+. Doma has various strengths:
- Verifies and generates source code at compile time using annotation processing.
- Provides type-safe Criteria API.
- Supports Kotlin.
- Uses SQL templates, called "two-way SQL".
- Has no dependence on other libraries.
Examples
Type-safe Criteria API
Written in Java 8:
Entityql entityql = new Entityql(config);
Employee_ e = new Employee_();
Department_ d = new Department_();
List<Employee> list = entityql
.from(e)
.innerJoin(d, on -> on.eq(e.departmentId, d.departmentId))
.where(c -> c.eq(d.departmentName, "SALES"))
.associate(e, d, (employee, department) -> {
employee.setDepartment(department);
department.getEmployeeList().add(employee);
})
.fetch();
Written in Kotlin:
val entityql = KEntityql(config)
val e = Employee_()
val d = Department_()
val list = entityql
.from(e)
.innerJoin(d) { eq(e.departmentId, d.departmentId) }
.where { eq(d.departmentName, "SALES") }
.associate(e, d) { employee, department ->
employee.department = department
department.employeeList += employee
}
.fetch()
See Criteria API for more information.
SQL templates
Written in Java 15:
@Dao
public interface EmployeeDao {
@Sql(
"""
select * from EMPLOYEE where
/*%if salary != null*/
SALARY >= /*salary*/9999
/*%end*/
""")
@Select
List<Employee> selectBySalary(BigDecimal salary);
}
See SQL templates for more information.
More Examples
Try Getting started.
For more complete examples, see simple-examples and spring-boot-jpetstore.
Installing
Gradle
For Java projects:
dependencies {
implementation("org.seasar.doma:doma-core:2.45.0")
annotationProcessor("org.seasar.doma:doma-processor:2.45.0")
}
For Kotlin projects, use doma-kotlin instead of doma-core and use kapt in place of annotationProcessor:
dependencies {
implementation("org.seasar.doma:doma-kotlin:2.45.0")
kapt("org.seasar.doma:doma-processor:2.45.0")
}
Maven
We recommend using Gradle, but if you want to use Maven, see below.
For Java projects:
...
<properties>
<doma.version>2.45.0</doma.version>
</properties>
...
<dependencies>
<dependency>
<groupId>org.seasar.doma</groupId>
<artifactId>doma-core</artifactId>
<version>${doma.version}</version>
</dependency>
</dependencies>
...
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source> <!-- depending on your project -->
<target>1.8</target> <!-- depending on your project -->
<annotationProcessorPaths>
<path>
<groupId>org.seasar.doma</groupId>
<artifactId>doma-processor</artifactId>
<version>${doma.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
</plugins>
</build>
For Kotlin projects, see Kotlin document.
Documentation
Forum
https://groups.google.com/g/doma-user
Chatroom
https://domaframework.zulipchat.com
Related projects
- quarkus-doma - Supports integration with Quarkus
- doma-spring-boot - Supports integration with Spring Boot
- doma-compile-plugin - Makes compilation easy
- doma-codegen-plugin - Generates Java and SQL files
Major versions
Status and Repository
Version | Status | Repository | Branch |
---|---|---|---|
Doma 1 | stable | https://github.com/seasarorg/doma/ | master |
Doma 2 | stable | https://github.com/domaframework/doma/ | master |
Compatibility matrix
Doma 1 | Doma 2 | |
---|---|---|
Java 6 | v | |
Java 7 | v | |
Java 8 | v | v |
Java 9 | v | |
Java 10 | v | |
Java 11 | v | |
Java 12 | v | |
Java 13 | v | |
Java 14 | v | |
Java 15 | v |
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].