On 11 December 2011 16:32, Kevin Meyer - KMZ <[email protected]> wrote:

>
> Problem is, this interface kills the Isis introspector - it eventually hits
> interface org.apache.cayenne.util.XMLSerializable, which has a List
> (Collection) parameter.
>
> I have two options:
> 1) Somehow disable the Isis introspector from walking down the
> Cayenne Persistor interface, or
>

I'd imagine this ought to be possible by writing a FacetFactory similar
to RemoveJavaLangObjectMethodsFacetFactory
or RemoveJavaLangComparableMethodsFacetFactory.  This would remove any of
the methods in the provided type (ie the cayenne interface).




> 2) Do some byte-code magic that is somehow able to wrap the users
> domain class picked up by Isis into something which implements
> Persisted, and can be given to Cayenne to instantiate.
>

This would be more elegant, but also more work.

The CgLibClassProxyFactory (and Javassist equivalent) work by (on-the-fly)
creating a subclass of the provided class.  I imagine that this subclass
could implement the cayenne interface.



>
> Option 2 requires me to somehow create a 1-to-1 mapping between
> user domain POJOs and runtime contructed classes that implement
> the Persisted interface, which Cayenne can instantiate, but that I can
> use to intercept Cayenne methods.
>
> Is this possible? To create new classes, based on existing classes,
> that can be instantiated?
>
Yup, it's what we do...


~~~
Just another thought; I know you have a distaste of the JPA annotations
etc, but even so my JPA object store - currently mothballed because it has
a dependency on the LGPL Hibernate library - might be easier to get fully
working, probably by porting to OpenJPA [1].  My view, for what it's worth,
is that JPA is more mainstream than Cayenne (and would help Isis grow its
userbase if we had it as a supported object store....).

I think that Mark is involved in OpenJPA - Mark, can you comment on how
OpenJPA picks up its metadata: is it only annotations, or is it optionally
XML, or even can it just infer some stuff?

Cheers
Dan



[1] http://openjpa.apache.org/



>
> Regards,
> Kevin
>
>
>

Reply via email to