Have you tried something like:

 SELECT d FROM worktime_monthly d WHERE d.daily_hours.whatever = $1

Yes, this will retrieve the parents as well as the children, but
because of the "depends" attribute rules thats all that is possible.
This should still get you what you need though.

Hope this helps!
-Nick

On 7/11/05, Andreas Vombach <[EMAIL PROTECTED]> wrote:
> With a 1:m castor mapping like
> 
> <class name="worktime_monthly" identity="id"
>     key-generator="MAX">
>     <map-to table="worktime_monthly"/>
>       <field name="id" type="integer">
>         <sql name="ID" type="integer" />
>       </field>
>       <field name="totalhours" type="java.lang.String">
>         <sql name="TOTALHOURS" type="char" />
>       </field>
>       <field name="daily_hours" type="worktime_daily"
> collection="arraylist">
>         <sql many-key="PARENT_worktime_monthly"/>
>       </field>
>     </class>
> 
>   <class name="worktime_daily" identity="id"
>     key-generator="MAX"
>     depends="persistence.worktime_monthly">
>     <map-to table="worktime_daily"/>
>       <field name="id" type="integer">
>         <sql name="ID" type="integer" />
>       </field>
>       <field name="workday" type="integer">
>         <sql name="WORKDAY" type="integer" />
>       </field>
>       <field name="workhours" type="java.lang.String">
>         <sql name="WORKHOURS" type="char" />
>       </field>
>       <field name="parent_worktime_monthly" type="worktime_monthly">
>         <sql name="PARENT_worktime_monthly" />
>       </field>
>     </class>
> 
> it is NOT possible to perform a OQLQuery on worktime_daily, only on
> worktime_monthly as far as I've tried.
> So, e.g. If I wanted to select all worktime where workday is 1 would I
> have to iterate over worktime_monthly or is there a more comfortable way?
> "select form worktime_daily where ..." seems not to be possible.
> 
> Thanks in advance
> Andreas
> 
> 
> -------------------------------------------------
> If you wish to unsubscribe from this list, please
> send an empty message to the following address:
> 
> [EMAIL PROTECTED]
> -------------------------------------------------
> 
>

-------------------------------------------------
If you wish to unsubscribe from this list, please
send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------

Reply via email to