I am not proposing the hints be provided by a config file again, and I don't propose that a new "Isis specific" object store annotation vocabulary be developed.
I would be interested in knowing if it is possible to use the DN meta data API to allow the JDO data store to make intelligent guesses (that'll generally be "right", or at least a default that is generally useable). If the un-annotated POJOs end up with a generally useable datastore, that'll be wonderful. Then, when the defaults are not good enough (some final deployment tweaking would improve behaviour or performance), let the developer provide JDO annotations as required. Of course, some Isis annotations (e.g. @Optional) also impact on the database (implicitly requiring "allowNulls = true") and there is possibly no way around this (unless one of the defaults to the datastore is that allowNulls is always true!) So goal is to get the objectstore "working" as soon as possible with no (or very few) data-store specific annotations on the POJOs. So, the question is: Can the metadata API provide enough input to DN that an introspector (using the Isis metamodel) can guess the required DN metadata for entities and properties (single valued and collections) if there are no annotations? I don't understand the relationship between JDO and DN, so I would need to do a lot of research first.. ;) Perhaps a better understanding would clarify why my goal is pointless (or impossible). > Yes, it's true that we now have the Isis metadata as secondary to the JDO > annotations. > > This breaks symmetry and means that, to deploy Isis against a different > ObjectStore, that at best those JDO annotations are redundant, at worst one > that one would have put in equivalent metadata for the other OS (eg SQL OS' > properties). > > As mentioned, we could invert this. Using the DataNucleus metadata API > [1], we could programmatically build up the DataNucleus metamodel from the > Isis metamodel. Where required, we could also recognize some subset of the > JDO annotations that have no Isis equivalent (eg "mappedBy" for > bidirectional annotations). Or, I suppose, we could add in our own > equivalent Isis annotations. > > I'm not convinced that this is the right thing to do though, for two > reasons ... [1] http://www.datanucleus.org/products/datanucleus/jdo/metadata_api.html
