On 06/21/2015 08:05 PM, Don Ferguson wrote:
For persistence, I use the ActiveObjects ORM library, originally developed by
Daniel Spiewak and now actively maintained by Atlassian. In AO, database
entities are described by java interfaces. For your use case (transient
objects that may or may not be persisted), I use a dynamic proxy whose
implementation can be serialized. When setters are called on the entity, the
proxy stores the (unsaved) data in a HashMap. An actual database record is
only created on an explicit call to entity.save().
By implementing it this way, panels that manipulate database records can
operate on either new (transient) records or records that already exist. If
the user cancels without saving, there is no detritus in the database to clean
up.
If anyone out there is interested in using AO with Wicket, I’d be happy to share my
code & experience. I like the AO programming model, and its support for
automatic schema migration means that you can change table definitions by
adding/removing setters and getters in the entity interfaces; AO can infer the SQL
to migrate tables to the new schema.
For a quick (but somewhat outdated) introduction to AO, see:
https://activeobjects.java.net/0.8.2/ActiveObjects.pdf
<https://activeobjects.java.net/0.8.2/ActiveObjects.pdf>
The repository can be found here: https://bitbucket.org/activeobjects
<https://bitbucket.org/activeobjects>
It’s an obscure framework, but I find it a pleasure to use, and it plays
reasonably well with Wicket.
-Don
Sounds interesting and I'll definitely be keeping an eye out for AO for future
projects. But for my current project I'll have to stick with Hibernate and by
hooking into the serialization process I have kind of made my own placeholder /
proxy. That approach seems to work fine so far.
Kind regards,
Edmund
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]