db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gupta...@gxs.com
Subject RE: OJB query! please help !
Date Fri, 10 Sep 2004 14:32:34 GMT
Thanks a lot Brian.. this explains all that I wanted to know...
Regards
-----Original Message-----
From: Brian McCallister [mailto:mccallister@forthillcompany.com]
Sent: Friday, September 10, 2004 7:28 PM
To: OJB Developers List
Subject: Re: OJB query! please help !


ODMG can, but the PB api is the strongest by a long shot.

Fetch groups in JDO refer to object and collection references, not 
specific attributes on an object. For instance:

public class Wombat
{
	private Integer id;
	private Integer age;
	private List magazines;
	private Submarine bobby;
}

create table wombats
(
	id integer primary key,
	age integer,
	submarine_id integer foreign key references (submarines(id))
)

create table magazines
(
	id integer primary key,
	wombat_id integer foreign key references (wombats(id)),
)

create table submarines
(
	id integer primary key
)

If you queried for Wombat you would *always* get age and id, regardless 
of fetch group.

If you declared a fetch group which included wombat.magazines and 
wombat.bobby you could query for wombat using that fetch group and the 
aforementioned references would be loaded. All simple attributes (and 
second class objects (I believe)) referenced from the primary will 
always be loaded in JDO. A vendor extension can allow for lazy-loading 
of attributes, and a couple vendors do this, but that is a rarely 
utilized or useful feature (I can imagine where it might be useful for 
really massive BLOBs, but that is about it).

Queries can care about only specific attributes, that is the normal 
case. Both the PB criteria api, and the ODMG OQL support queries 
defined based on only a subset of attributes. If you only want specific 
attributes, you will probably be better off using a report query 
(projection) which the PB api supports very well, the ODMG does not, 
however. This basically returns tuples of data specified in the query.

The JDO 2 spec definitely includes fetch group support, and OJB will 
implement it as specified.

-Brian

On Sep 10, 2004, at 9:35 AM, GuptaTTG@gxs.com wrote:

> Thanks Brian.
> Couple of more questions.
>
> 1. Would you recommend to use the ODMG API instead ? and will that 
> support
> the below mentioned requirement ?
> 2. Will JDO 2.0 have the "Fetch groups" feature ?
>
> Regards
> Tarun
>
>
> -----Original Message-----
> From: Brian McCallister [mailto:mccallister@forthillcompany.com]
> Sent: Friday, September 10, 2004 6:44 PM
> To: OJB Developers List
> Subject: Re: OJB query! please help !
>
>
> In all honesty, I wouldn't recommend using OJB's JDO api yet. The
> existing JDO 1.0.1 implementation is quite weak, and is more
> proof-of-concept than anything. The reflective nature of OJB
> persistence just never really encouraged anyone to flesh out 1.0.1.
>
> We are actively working on a JDO 2.0 right now (supports reflective
> persistence), with an (optimistic) timeline of around November for it
> being usable. This largely depends on where the spec goes as the last
> public showing of the spec was in June and rumour has it more changes
> to it are coming from feedback garnered then =)
>
> -Brian
>
> On Sep 10, 2004, at 9:05 AM, GuptaTTG@gxs.com wrote:
>
>> Hi
>>
>> I am currently evaluating different JDO products to use in my project.
>> Right now I am in the process of evaluating OJB (JDO API) and and
>> trying to
>> reverse engineer from the DB schema.
>>
>> We are building a search facility using a JDO solution we are
>> considering to
>> use OJB for this purpose. We have a requirement to allow the search
>> users to
>> search only a subset of attributes from a class. For example an entity
>> consists of 10 attributes but if the users is interested only in two
>> attributes then he should be able to specify only those two attributes
>> in
>> the search. Some of JDO solutions support this feature by allowing
>> "Featch
>> groups" in JDO queries. My question is does OJB - JDO support this
>> feature,
>> or is there any other way to implement this using OJB - JDO.
>>
>> Thanks in Advance.
>> Regards,
>> Tarun
>>
>>
>>
>>
>
>
>
> ---------------------------------------------------------------------
> 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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message