openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From matthew <>
Subject Persistent interfaces enhancement
Date Thu, 24 Sep 2009 16:27:23 GMT
Hi all,

I wanted to see what it would take to enhance the support for
persistent fields of an interface type.

Currently, OpenJPA stringifies the object id of the instance being
stored, rendering the relation unqueriable.  If this could be enhanced
to support the fairly common use case (IMHO) of entities that use
single field identity, the id value and type information could be
separated and stored in two columns.  This would make it possible to
query through the relationship predictably.  I forsee the types of the
columns being string, so as to support any stringifiable single field
identity value and a type.

One possible implementation that puts all of this info in one place
could be this:

// Some class that has a persistent interface field
public class Calendar {
    // ...
    protected Schedulable schedulable;

In this manner, queries across persistent interfaces becomes a bit
more predictable and, probably more importantly, the storage of an
interface type becomes much more palatable to a DBA.  A stringified
version of the object id, which includes its Java class information,
is certainly not something many DBAs would like.




View raw message