db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Clute, Andrew" <Andrew.Cl...@osn.state.oh.us>
Subject RE: Any plans for Reference filters?
Date Thu, 23 Sep 2004 18:51:06 GMT
Can you put a query customizer on a reference descriptor? I thought they
were only for collections!

-Andrew

 

-----Original Message-----
From: Jakob Braeuchi [mailto:jbraeuchi@gmx.ch] 
Sent: Thursday, September 23, 2004 12:59 PM
To: OJB Developers List
Subject: Re: Any plans for Reference filters?

hi andrew,

you could use a query customizer to manipulate reference queries. i
admit it's not as elegant as the filter but it's totally flexibel ;)

jakob

Clute, Andrew schrieb:
> I have run into a couple of scenarios where it would be extremely 
> helpful to be able to add additional criteria to a reference
descriptor.
>  
> For instance, you might have a Person object with a collection of 
> Addresses on them. Address might have a property called "Primary". In 
> your query, you might want to be able to qualify to use the primary 
> address. The current way to do that is to keep a foreign key on your 
> person table that links back to the primacy address object, and update

> that when your primacy address changes. So, you have both a property 
> on your object, and a db column.
>  
> It would be nice if you could still have that reference descriptor for

> your person object for a Primary Address, but not maintain the foreign

> key in the db, just had a certain criteria to the descriptor that 
> filters it to the appropriate one.
>  
> For instance:
>  
> <reference-descriptor
> 	name="primaryAddress"
> 	class-ref="pojo.Address"
> 	refresh="true"
> 	auto-retrieve="true"
> 	auto-update="false"
> 	auto-delete="false"
> 
> 	<foreignkey field-ref="personPK"/>
> 	<foreignkey-filter value="is_primary=1"/>
</reference-descriptor>
> 
>  
> Does that make sense? Just curious if this has ever been discussed.
>  
> Thanks!
>  
> -Andrew
>  
> 
> 
> ---------------------------------------------------------------------
> 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


Mime
View raw message