Skip to main content

Object Mapping

Hint

This article is generated by AI translation.

dbVisitor strips out relational mapping and keeps only object mapping, simplifying database operations via the Fluent API.

dbVisitor object mapping highlights
  • Gentle learning curve without heavy concepts.
  • SQL dialects hide database differences when using the Fluent API.
  • No relational mapping support (no 1-1, 1-n, n-1, n-n).

Guide

Mapping

  • Annotations: use @Table and @Column to map types to tables or views.
  • Mapper File: map via the <entity> tag in mapper XML.
  • Key Generators: generate keys (sequences, UUID, or fetch auto-increment after insert).
  • TypeHandler: handle enums, JSON, and special JDBC types in column mapping.

Tips

  • Camel case: auto-convert camel case to snake case.
  • Name sensitivity: handle case sensitivity and reserved-word identifiers.
  • Write Policy: decide whether a field participates in INSERT/UPDATE when using Fluent API.
  • Statement Templates: customize SQL fragments, e.g., MySQL point handling.