Problems with the @NotPersisted annotation
13 Feb 2011, 06:04
barry woods (1 post)
I have recently purchased your book and am quite excited by the possibilities that the Naked Objects framework offers.
I am currently building a prototype app using the XML object store so I can see what is being persisted. This app is based around projects that will be represented as nodes in a graph that end users can walk in the client UI. (i.e. each project could have multiple parents and children which equate to related projects and sub-projects). I have setup a bi-directional relationship between the nodes using an interposed link object that contains additional attributes pertaining to the relationship.
These relations between nodes need to be filtered according to the user, the relationship type and other attributes of the relationship contained within the link object. Most users would be unaware of the link object and its attributes and it is therefore hidden from the UI.
My idea was to perform a query against the link objects to obtain the set of relations that apply for a particular scenario, and use that set to dynamically populate a collection contained within the current visible Project object and thus exposing the sub-projects in the UI.
I have annotated this collection with the @NotPersisted annotation. However despite this annotation the dynamic collection is being persisted in the XML object store.
I somewhat nonplussed by this and feel maybe I am missing some concept here. Any help or suggestions you can offer would be greatly appreciated.
Hope all this makes sense,
06 Mar 2011, 18:28
Dan Haywood (131 posts)
Hi Barry, First off, apologies for my tardy response.
Second, I don’t think you’ve misunderstood anything, and this does sound like the XML object store is at fault.
I imagine you’ve noticed that since I wrote the book we’ve taken Naked Objects + my sister projects into the Apache incubator, called Apache Isis. Could you therefore raise a JIRA ticket against the XML objectstore using the JIRA instance (https://issues.apache.org/jira/browse/ISIS), ideally with a small test example?
Hope you continue to enjoy working with Naked Objects/Isis, and do check out the new website (http://incubator.apache.org/isis/) and the isis-dev mailing list.
|You must be logged in to comment|