Skip to content
Anjunar/ DOCS

API and limits

Look up the public API, supported mappings and rejected operations.

Modules

A public runtime API

hibernate-i18n-core supplies the annotations. hibernate-i18n contains the mapping bootstrap, locale-bound Sessions, typed editor and schema integration. There is one runtime artifact.

HibernateI18n.registryBuilder()
Creates a Hibernate registry builder with translation mapping contributors.
HibernateI18n.install(factory, entityClass, idOf, fields)
Installs one entity bridge and returns its typed translation handle.
HibernateI18n.openSession(factory, locale[, tenantId])
Opens a Session with fixed content locale and optional tenant after checking installed bridges.
TranslationField.string(name, read)
Describes an ordinary String translation field.
TranslationField.converted(name, read, toDatabase, fromDatabase)
Describes a converted value with matching String encoding and decoding.
translations.get(session, entity, field, locale)
Returns Option of the exact locale value, with no fallback.
translations.set(session, entity, field, locale, value)
Writes an inactive locale override; null clears it.
translations.copyInactive(session, from, to)
Copies stored non-active locale rows and returns their count.
Scope

Know the supported contract

These constraints are part of the 1.0.0 runtime contract. Check a new version's source and integration tests before adopting it.

Supported mapping shape
One UUID ID, String database values, and consistent field or JavaBean getter access.
Simple column identifiers; table names may also contain #.
String @TenantId for shared-table isolation.
Translated mapped-superclass members may feed one entity mapping per factory.
Rejected operations

Detached merge and replicate, mixed access and @Column on translated attributes are rejected. Query caching is rejected; second-level caching is disabled for localized entity hierarchies. Unrelated entities may still use their cache.

Managed edits

Load the entity in the target locale before editing its ordinary fields. New entities use persist. Always install all localized entities before opening Sessions.