final fields persistence

#1

(I already wrote the body here, but somehow it got lost; so I'm retrying; apologies if it appears twice.)

===========

We love the idea of using ObjetDb, but 99% of our Java entities are immutable, and auto generated using https://immutables.github.io/ -- which creates final fields. Is there any way to support those in ObjectDb? (I've learned that, techincally, JPA does NOT prohibit final fields, though JDO might. And, Hibernate supports final fields (though most other JPA providers do not.) Thoughts?

#2

Final fields are transient in JPA/JDO by default.

Although persistent final fields are not supported by ObjectDB officially, it still may work if you specify specific final fields as persistent, using the @Persistent annotation (from JDO) or using the equivalent external XML persistence-modifier=persistent.

ObjectDB Support

Reply