Generated Computers
Locals는 Apple Silicon 엔진으로 로컬 LLM을 최대 3배 빠르게 실행하는 Generated Computers 제품
DAO 지향 데이터베이스 매핑 프레임워크 for Java
DAO oriented database mapping framework for Java
개발 도구Java · KotlinGitHub @domaframework직접 설치운영자 미확인
써 보셨어요? 한 번만 눌러 주세요. 로그인은 필요 없어요.
메이커가 쓴 소개는 위의 한 줄이 전부입니다. 더 자세한 내용은 저장소 README에서 읽을 수 있습니다. 저장소 README ↗
README 전체를 불러오는 중입니다.
README 전문 보기 ↗Doma is a database access framework for Java with several notable strengths:
If you use Doma in your project or enterprise and would like to support ongoing development, please consider becoming a backer.
The latest major version of Doma supports Java 17 and above. If you are using Java 8, please use Doma 2.
See also Major versions.
We are testing against the following databases:
| Database | version | status |
|---|---|---|
| H2 Database | 2.5.252 | stable |
| MySQL v5 | 5.7 | stable |
| MySQL v8 | 8.0.36 | stable |
| Oracle Database Free | 23.4 | stable |
| PostgreSQL | 12.20 | stable |
| SQLite | 3.54.1.0 | stable |
| SQL Server | 2019 | stable |
This code uses a type-safe Criteria API to fetch employees from a specific department while establishing associations between the related entities:
var queryDsl = new QueryDsl(config);
var e = new Employee_();
var d = new Department_();
var employees = queryDsl
.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();
See Unified Criteria API for more information.
This code uses an SQL template to fetch employees from a specific department while establishing associations between the related entities:
@Dao
public interface EmployeeDao {
@Sql(
"""
select
/*%expand*/*
from
EMPLOYEE e
inner join
DEPARTMENT d
on e.departmentId = d.departmentId
where
/*%if departmentName != null*/
d.DEPARTMENT_NAME = /*departmentName*/'test'
/*%end*/
""")
@Select(aggregateStrategy = EmployeeStrategy.class)
List<Employee> selectByDepartmentName(String departmentName);
@AggregateStrategy(root = Employee.class, tableAlias = "e")
interface EmployeeStrategy {
@AssociationLinker(propertyPath = "department", tableAlias = "d")
BiFunction<Employee, Department, Employee> department = (e, d) -> {
e.setDepartment(d);
d.getEmployees().add(e);
return e;
};
}
}
See SQL templates and Aggregate strategies for more information.
Try Getting started and simple-examples.
Doma checks SQL templates, bind variables and DAO signatures at compile time,
so many mistakes in code written by AI coding agents fail the build with a DOMA error
that the agent can read and fix, instead of failing later at runtime.
For Java projects:
plugins {
id("org.domaframework.doma.compile") version "4.0.4"
}
dependencies {
implementation("org.seasar.doma:doma-core:3.15.0")
annotationProcessor("org.seasar.doma:doma-processor:3.15.0")
}
For Kotlin projects, use doma-kotlin instead of doma-core and use kapt in place of annotationProcessor:
plugins {
id("org.domaframework.doma.compile") version "4.0.4"
}
dependencies {
implementation("org.seasar.doma:doma-kotlin:3.15.0")
kapt("org.seasar.doma:doma-processor:3.15.0")
}
We recommend using Gradle, but if you want to use Maven, see below.
For Java projects:
...
<properties>
<doma.version>3.15.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>17</source> <!-- depending on your project -->
<target>17</target> <!-- depending on your project -->
<annotationProcessorPaths>
<path>
<groupId>org.seasar.doma</groupId>
<artifactId>doma-processor</artifactId>
<version>${doma.version}</version>
</path>
</annotationProcessorPaths>
<compilerArgs>
<!-- if you are using a Maven project in Eclipse, this argument is required -->
<arg>-Adoma.resources.dir=${project.basedir}/src/main/resources</arg>
</compilerArgs>
</configuration>
</plugin>
</plugins>
</build>
For Kotlin projects, see Kotlin document.
https://domaframework.zulipchat.com
| Version | Status | Repository | Branch |
|---|---|---|---|
| Doma 1 | limited-support | https://github.com/seasarorg/doma/ | master |
| Doma 2 | limited-support | https://github.com/domaframework/doma/ | 2.x |
| Doma 3 | stable | https://github.com/domaframework/doma/ | master |
| Doma 1 | Doma 2 | Doma 3 | |
|---|---|---|---|
| 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 | ||
| Java 16 | v | ||
| Java 17 | v | v | |
| Java 18 | v | v | |
| Java 19 | v | v | |
| Java 20 | v | v | |
| Java 21 | v | v | |
| Java 22 | v | v | |
| Java 23 | v | ||
| Java 24 | v | ||
| Java 25 | v | ||
| Java 26 | v | ||
| Java 27 | v |