You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by Craig L Russell <Cr...@Sun.COM> on 2008/08/28 01:05:44 UTC

FetchGroup implementation

The JDO expert group has adopted a user-level API for configuring  
FetchGroups at runtime. There is a factory for FetchGroup in the  
PersistenceManager and PersistenceManagerFactory, corresponding to  
EntityManager and EntityManagerFactory.

I'd like to implement this concept for OpenJPA, and have a few  
questions before I start.

Currently there is an Annotation  
org.apache.openjpa.persistence.FetchGroup that allows an annotation to  
be defined for a class or field. There are also FetchPlan.java and  
FetchPlanImpl.java in that same package. The FetchPlan is the  
interface (not standard) and the FetchPlanImpl is the implementation  
for the FetchPlan interface.

So if we want to have an interface representing the FetchGroup how do  
we avoid the name conflict between the annotation name and the  
interface name for FetchGroup?

Craig

Craig L Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!


Re: FetchGroup implementation

Posted by Craig L Russell <Cr...@Sun.COM>.
Hi Kevin,

On Aug 28, 2008, at 2:45 PM, Kevin Sutter wrote:

> Craig,
> Comments below...
>
> On Thu, Aug 28, 2008 at 4:21 PM, Craig L Russell <Craig.Russell@sun.com 
> >wrote:
>
>>
>> On Aug 27, 2008, at 4:05 PM, Craig L Russell wrote:
>>
>> The JDO expert group has adopted a user-level API for configuring
>>> FetchGroups at runtime. There is a factory for FetchGroup in the
>>> PersistenceManager and PersistenceManagerFactory, corresponding to
>>> EntityManager and EntityManagerFactory.
>>>
>>> I'd like to implement this concept for OpenJPA, and have a few  
>>> questions
>>> before I start.
>>>
>>> Currently there is an Annotation  
>>> org.apache.openjpa.persistence.FetchGroup
>>> that allows an annotation to be defined for a class or field.  
>>> There are also
>>> FetchPlan.java and FetchPlanImpl.java in that same package. The  
>>> FetchPlan is
>>> the interface (not standard) and the FetchPlanImpl is the  
>>> implementation for
>>> the FetchPlan interface.
>>>
>>> So if we want to have an interface representing the FetchGroup how  
>>> do we
>>> avoid the name conflict between the annotation name and the  
>>> interface name
>>> for FetchGroup?
>>>
>>
>> This name conflict is making me crazy. Why did we put annotations  
>> into the
>> same package as interfaces and implementations?
>>
>> FetchPlan is an interface but it might also be an annotation in  
>> future,
>> along with FetchPlans. These annotations would allow you to define  
>> named
>> fetch plans in annotations that could be used for static definition  
>> of fetch
>> plans for queries, etc. without needing an API. Sort of the inverse  
>> of what
>> we found useful in FetchGroup.
>>
>> What if we moved all the annotations currently in
>> org.apache.openjpa.persistence to org.apache.openjpa.annotations,  
>> deprecate
>> the current annotation definitions in org.apache.openjpa.persistence?
>
>
> Although I can understand the frustration with the current  
> organization,
> moving and deprecating the current annotations would be a major
> compatibility issue as we move forward.  Besides the native OpenJPA
> applications, we have many other packagers of OpenJPA (IBM, BEA,  
> others?)
> that have documented the use of OpenJPA annotations.  Changing these  
> now
> would be disruptive.
>
> Since the use of the annotation would be more common than the  
> interface, I
> would prefer to separate out the interfaces into a new directory.   
> But, even
> that, I'm not thrilled with.

I understand and thought that throwing out a proposal would stimulate  
some thought.

I really hate all of these options:

creating a new directory in which we put only FetchGroup (the  
interface) and FetchGroupImpl (the implementation of the interface)

deprecating and breaking existing applications

keeping both interfaces and annotations in the same place

calling FetchGroup something entirely different, although calling it  
OpenJPAFetchGroup, or JDOFetchGroup might not be a bad idea

Of all the unattractive options, I'd probably vote for the latter  
(lattest?) (JDOFetchGroup).

Craig
>
>
> Kevin
>
>
>>
>> Craig
>>
>>
>>>
>>> Craig
>>>
>>> Craig L Russell
>>> Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
>>> 408 276-5638 mailto:Craig.Russell@sun.com
>>> P.S. A good JDO? O, Gasp!
>>>
>>>
>> Craig L Russell
>> Architect, Sun Java Enterprise System http://java.sun.com/products/ 
>> jdo
>> 408 276-5638 mailto:Craig.Russell@sun.com
>> P.S. A good JDO? O, Gasp!
>>
>>

Craig L Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!


Re: FetchGroup implementation

Posted by Kevin Sutter <kw...@gmail.com>.
Craig,
Comments below...

On Thu, Aug 28, 2008 at 4:21 PM, Craig L Russell <Cr...@sun.com>wrote:

>
> On Aug 27, 2008, at 4:05 PM, Craig L Russell wrote:
>
>  The JDO expert group has adopted a user-level API for configuring
>> FetchGroups at runtime. There is a factory for FetchGroup in the
>> PersistenceManager and PersistenceManagerFactory, corresponding to
>> EntityManager and EntityManagerFactory.
>>
>> I'd like to implement this concept for OpenJPA, and have a few questions
>> before I start.
>>
>> Currently there is an Annotation org.apache.openjpa.persistence.FetchGroup
>> that allows an annotation to be defined for a class or field. There are also
>> FetchPlan.java and FetchPlanImpl.java in that same package. The FetchPlan is
>> the interface (not standard) and the FetchPlanImpl is the implementation for
>> the FetchPlan interface.
>>
>> So if we want to have an interface representing the FetchGroup how do we
>> avoid the name conflict between the annotation name and the interface name
>> for FetchGroup?
>>
>
> This name conflict is making me crazy. Why did we put annotations into the
> same package as interfaces and implementations?
>
> FetchPlan is an interface but it might also be an annotation in future,
> along with FetchPlans. These annotations would allow you to define named
> fetch plans in annotations that could be used for static definition of fetch
> plans for queries, etc. without needing an API. Sort of the inverse of what
> we found useful in FetchGroup.
>
> What if we moved all the annotations currently in
> org.apache.openjpa.persistence to org.apache.openjpa.annotations, deprecate
> the current annotation definitions in org.apache.openjpa.persistence?


Although I can understand the frustration with the current organization,
moving and deprecating the current annotations would be a major
compatibility issue as we move forward.  Besides the native OpenJPA
applications, we have many other packagers of OpenJPA (IBM, BEA, others?)
that have documented the use of OpenJPA annotations.  Changing these now
would be disruptive.

Since the use of the annotation would be more common than the interface, I
would prefer to separate out the interfaces into a new directory.  But, even
that, I'm not thrilled with.

Kevin


>
> Craig
>
>
>>
>> Craig
>>
>> Craig L Russell
>> Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
>> 408 276-5638 mailto:Craig.Russell@sun.com
>> P.S. A good JDO? O, Gasp!
>>
>>
> Craig L Russell
> Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
> 408 276-5638 mailto:Craig.Russell@sun.com
> P.S. A good JDO? O, Gasp!
>
>

Re: FetchGroup implementation

Posted by Craig L Russell <Cr...@Sun.COM>.
On Aug 27, 2008, at 4:05 PM, Craig L Russell wrote:

> The JDO expert group has adopted a user-level API for configuring  
> FetchGroups at runtime. There is a factory for FetchGroup in the  
> PersistenceManager and PersistenceManagerFactory, corresponding to  
> EntityManager and EntityManagerFactory.
>
> I'd like to implement this concept for OpenJPA, and have a few  
> questions before I start.
>
> Currently there is an Annotation  
> org.apache.openjpa.persistence.FetchGroup that allows an annotation  
> to be defined for a class or field. There are also FetchPlan.java  
> and FetchPlanImpl.java in that same package. The FetchPlan is the  
> interface (not standard) and the FetchPlanImpl is the implementation  
> for the FetchPlan interface.
>
> So if we want to have an interface representing the FetchGroup how  
> do we avoid the name conflict between the annotation name and the  
> interface name for FetchGroup?

This name conflict is making me crazy. Why did we put annotations into  
the same package as interfaces and implementations?

FetchPlan is an interface but it might also be an annotation in  
future, along with FetchPlans. These annotations would allow you to  
define named fetch plans in annotations that could be used for static  
definition of fetch plans for queries, etc. without needing an API.  
Sort of the inverse of what we found useful in FetchGroup.

What if we moved all the annotations currently in  
org.apache.openjpa.persistence to org.apache.openjpa.annotations,  
deprecate the current annotation definitions in  
org.apache.openjpa.persistence?

Craig
>
>
> Craig
>
> Craig L Russell
> Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
> 408 276-5638 mailto:Craig.Russell@sun.com
> P.S. A good JDO? O, Gasp!
>

Craig L Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!


Re: FetchGroup implementation

Posted by Craig L Russell <Cr...@Sun.COM>.
By the way, the interface definition and discussion can be seen here:

http://issues.apache.org/jira/browse/JDO-554

Craig

On Aug 27, 2008, at 4:05 PM, Craig L Russell wrote:

> The JDO expert group has adopted a user-level API for configuring  
> FetchGroups at runtime. There is a factory for FetchGroup in the  
> PersistenceManager and PersistenceManagerFactory, corresponding to  
> EntityManager and EntityManagerFactory.
>
> I'd like to implement this concept for OpenJPA, and have a few  
> questions before I start.
>
> Currently there is an Annotation  
> org.apache.openjpa.persistence.FetchGroup that allows an annotation  
> to be defined for a class or field. There are also FetchPlan.java  
> and FetchPlanImpl.java in that same package. The FetchPlan is the  
> interface (not standard) and the FetchPlanImpl is the implementation  
> for the FetchPlan interface.
>
> So if we want to have an interface representing the FetchGroup how  
> do we avoid the name conflict between the annotation name and the  
> interface name for FetchGroup?
>
> Craig
>
> Craig L Russell
> Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
> 408 276-5638 mailto:Craig.Russell@sun.com
> P.S. A good JDO? O, Gasp!
>

Craig L Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!