You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by Brian McCallister <mc...@forthillcompany.com> on 2004/05/03 01:34:04 UTC

PB/OTM Question for JDO

Is there any means of executing a query against an extent that 
specifically excludes subclasses?

class A {}
class B extends A {}

Query for A without getting any B's even though the extent is declared 
in metadata?

This behavior is required for JDO:

     /**
      * @param aClass top level class
      * @param include_extent      include subclasses, presently ignored
      * @return
      * @todo figure out how to implement, may have to query all and 
filter objects
      */
     public Extent getExtent(Class aClass, boolean include_extent)
     {
         if (!include_extent) throw new 
UnsupportedOperationException("Not yet implemented!");
         if (isClosed())
         {
             throw new 
JDOFatalUserException(generateIsClosedErrorMessage("getExtent(Class, 
boolean)"));
         }
         return new ExtentImpl(aClass, m_conn, this, include_extent);
     }

Needs to be able to have a boolean flag (include_extent) which 
specifies this behavior =(

-Brian



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Re: PB/OTM Question for JDO

Posted by Robert Sfeir <ro...@codepuccino.com>.
Hey I'd love to see and test this functionality.  Adding a boolean to 
not/retrieve the extents is pretty awesome.  The problem is that if you 
check it in, and people see it in the API and try to use it, it might 
cause headaches.  I would wait until 1.0 is branched then check it in I 
think, to be sure that when 1.0 is spit out, it only has what was 
intended to be there.

Others might feel differently :-)

R

On May 4, 2004, at 9:12 AM, Armin Waibel wrote:

> Hi Robert,
>
> Robert Sfeir wrote:
>> Looks like we're gonna have to write something to get the wish we've 
>> had for a while, one that will allow us to fetch dependencies or not. 
>>  Is this a big rewrite?  I would apply this change to auto-update and 
>> delete also.
>
> Locally I have it done a while ago. Should I check in this stuff?
> This should not affect stability of OJB, because it only by pass when 
> not used.
>
> regards,
> Armin
>
>> R
>> On May 2, 2004, at 7:34 PM, Brian McCallister wrote:
>>> Is there any means of executing a query against an extent that 
>>> specifically excludes subclasses?
>>>
>>> class A {}
>>> class B extends A {}
>>>
>>> Query for A without getting any B's even though the extent is 
>>> declared in metadata?
>>>
>>> This behavior is required for JDO:
>>>
>>>     /**
>>>      * @param aClass top level class
>>>      * @param include_extent      include subclasses, presently 
>>> ignored
>>>      * @return
>>>      * @todo figure out how to implement, may have to query all and 
>>> filter objects
>>>      */
>>>     public Extent getExtent(Class aClass, boolean include_extent)
>>>     {
>>>         if (!include_extent) throw new 
>>> UnsupportedOperationException("Not yet implemented!");
>>>         if (isClosed())
>>>         {
>>>             throw new 
>>> JDOFatalUserException(generateIsClosedErrorMessage("getExtent(Class, 
>>> boolean)"));
>>>         }
>>>         return new ExtentImpl(aClass, m_conn, this, include_extent);
>>>     }
>>>
>>> Needs to be able to have a boolean flag (include_extent) which 
>>> specifies this behavior =(
>>>
>>> -Brian
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>>> For additional commands, e-mail: ojb-dev-help@db.apache.org
>>>
>> Robert S. Sfeir
>> Technical Lead
>> HHS Portal
>> robert_sfeir@sra.com
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>> For additional commands, e-mail: ojb-dev-help@db.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
>
Robert S. Sfeir
Technical Lead
HHS Portal
robert_sfeir@sra.com


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Re: PB/OTM Question for JDO

Posted by Armin Waibel <ar...@apache.org>.
Hi Robert,

Robert Sfeir wrote:
> Looks like we're gonna have to write something to get the wish we've had 
> for a while, one that will allow us to fetch dependencies or not.  Is 
> this a big rewrite?  I would apply this change to auto-update and delete 
> also.
> 

Locally I have it done a while ago. Should I check in this stuff?
This should not affect stability of OJB, because it only by pass when 
not used.

regards,
Armin

> R
> 
> On May 2, 2004, at 7:34 PM, Brian McCallister wrote:
> 
>> Is there any means of executing a query against an extent that 
>> specifically excludes subclasses?
>>
>> class A {}
>> class B extends A {}
>>
>> Query for A without getting any B's even though the extent is declared 
>> in metadata?
>>
>> This behavior is required for JDO:
>>
>>     /**
>>      * @param aClass top level class
>>      * @param include_extent      include subclasses, presently ignored
>>      * @return
>>      * @todo figure out how to implement, may have to query all and 
>> filter objects
>>      */
>>     public Extent getExtent(Class aClass, boolean include_extent)
>>     {
>>         if (!include_extent) throw new 
>> UnsupportedOperationException("Not yet implemented!");
>>         if (isClosed())
>>         {
>>             throw new 
>> JDOFatalUserException(generateIsClosedErrorMessage("getExtent(Class, 
>> boolean)"));
>>         }
>>         return new ExtentImpl(aClass, m_conn, this, include_extent);
>>     }
>>
>> Needs to be able to have a boolean flag (include_extent) which 
>> specifies this behavior =(
>>
>> -Brian
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>> For additional commands, e-mail: ojb-dev-help@db.apache.org
>>
> Robert S. Sfeir
> Technical Lead
> HHS Portal
> robert_sfeir@sra.com
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Re: PB/OTM Question for JDO

Posted by Robert Sfeir <ro...@codepuccino.com>.
Looks like we're gonna have to write something to get the wish we've 
had for a while, one that will allow us to fetch dependencies or not.  
Is this a big rewrite?  I would apply this change to auto-update and 
delete also.

R

On May 2, 2004, at 7:34 PM, Brian McCallister wrote:

> Is there any means of executing a query against an extent that 
> specifically excludes subclasses?
>
> class A {}
> class B extends A {}
>
> Query for A without getting any B's even though the extent is declared 
> in metadata?
>
> This behavior is required for JDO:
>
>     /**
>      * @param aClass top level class
>      * @param include_extent      include subclasses, presently ignored
>      * @return
>      * @todo figure out how to implement, may have to query all and 
> filter objects
>      */
>     public Extent getExtent(Class aClass, boolean include_extent)
>     {
>         if (!include_extent) throw new 
> UnsupportedOperationException("Not yet implemented!");
>         if (isClosed())
>         {
>             throw new 
> JDOFatalUserException(generateIsClosedErrorMessage("getExtent(Class, 
> boolean)"));
>         }
>         return new ExtentImpl(aClass, m_conn, this, include_extent);
>     }
>
> Needs to be able to have a boolean flag (include_extent) which 
> specifies this behavior =(
>
> -Brian
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
>
Robert S. Sfeir
Technical Lead
HHS Portal
robert_sfeir@sra.com


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Re: PB/OTM Question for JDO

Posted by Jakob Braeuchi <jb...@gmx.ch>.
hi thomas, brian,

looks like we need an api-change in persistence-broker after 1.0.

jakob

Thomas Mahler wrote:

> Hi again Brian,
> 
> at the moment the only way I know will be to tweak the metadata of clas 
> A at runtime to not contain any derived classes.
> 
> cheers,
> Thomas
> 
> Brian McCallister wrote:
> 
>> Is there any means of executing a query against an extent that 
>> specifically excludes subclasses?
>>
>> class A {}
>> class B extends A {}
>>
>> Query for A without getting any B's even though the extent is declared 
>> in metadata?
>>
>> This behavior is required for JDO:
>>
>>     /**
>>      * @param aClass top level class
>>      * @param include_extent      include subclasses, presently ignored
>>      * @return
>>      * @todo figure out how to implement, may have to query all and 
>> filter objects
>>      */
>>     public Extent getExtent(Class aClass, boolean include_extent)
>>     {
>>         if (!include_extent) throw new 
>> UnsupportedOperationException("Not yet implemented!");
>>         if (isClosed())
>>         {
>>             throw new 
>> JDOFatalUserException(generateIsClosedErrorMessage("getExtent(Class, 
>> boolean)"));
>>         }
>>         return new ExtentImpl(aClass, m_conn, this, include_extent);
>>     }
>>
>> Needs to be able to have a boolean flag (include_extent) which 
>> specifies this behavior =(
>>
>> -Brian
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>> For additional commands, e-mail: ojb-dev-help@db.apache.org
>>
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Re: PB/OTM Question for JDO

Posted by Thomas Mahler <th...@web.de>.
Hi again Brian,

at the moment the only way I know will be to tweak the metadata of clas 
A at runtime to not contain any derived classes.

cheers,
Thomas

Brian McCallister wrote:
> Is there any means of executing a query against an extent that 
> specifically excludes subclasses?
> 
> class A {}
> class B extends A {}
> 
> Query for A without getting any B's even though the extent is declared 
> in metadata?
> 
> This behavior is required for JDO:
> 
>     /**
>      * @param aClass top level class
>      * @param include_extent      include subclasses, presently ignored
>      * @return
>      * @todo figure out how to implement, may have to query all and 
> filter objects
>      */
>     public Extent getExtent(Class aClass, boolean include_extent)
>     {
>         if (!include_extent) throw new 
> UnsupportedOperationException("Not yet implemented!");
>         if (isClosed())
>         {
>             throw new 
> JDOFatalUserException(generateIsClosedErrorMessage("getExtent(Class, 
> boolean)"));
>         }
>         return new ExtentImpl(aClass, m_conn, this, include_extent);
>     }
> 
> Needs to be able to have a boolean flag (include_extent) which specifies 
> this behavior =(
> 
> -Brian
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org