The name "Doma" comes from the "Dao Oriented database MApping framework".
Annotation processing, that was introduced in Java 6, allows us to validate and generate source code at compile time.
We use annotation processing for the following purposes:
- Generating meta classes from the classes annotated with
@Entity
and@Domain
. - Generating implementation classes of the interfaces annotated with
@Dao
. - Validating SQL templates.
JRE 8, 9, 10, 11 and 12.
None.
Doma has no dependencies on other libraries.
JDK 8, 9, 10, 11 and 12.
We recommend Eclipse and IntelliJ IDEA.
In Eclipse, the jar file of Doma is added to the Java Build Path but annotation processing doesn't run.
Enable annotation processing and add the jar file to the Factory Path too. See also eclipse-build
.
In Eclipse, they are found in the .apt_generated directory.
You can find it in the Navigator view.
You may get the following message, though the file exists:
[DOMA4019] The file[META-INF/../select.sql] is not found from the classpath
When you use Eclipse, check that the location of the output folder of resources is same as the one for the class files in the Java Build Path dialog.
When you use Gradle, check that the resource files are copied to compileJava.destinationDir
in advance of the compileJava task. See also build-with-gradle
.
Yes, Doma generates the following statements:
- INSERT
- DELETE
- UPDATE
- Stored procedure call
- Stored function call
Doma doesn't generate SELECT statements but executes arbitrary SELECT statements and maps the results to the Java objects.
See also query/index
for detailed information.
Dynamic SQL statements are built by directives that are represented by the SQL comments.
See also sql
for detail information.
No.
Doma only maps each row of the SQL result set to a Java entity instance.
No.
Use Doma together with a JDBC connection pool library such as HikariCP.