Hi Oleg,
What I want is to have two unidirectionnal relationships 1-n between the
classes Product and ProductDetail for example so my mapping file looks like:
<class name="myapp.Product" identity="id" key-generator="MAX">
<description>Product definition</description>
<map-to table="prod" />
<field name="id" type="integer">
<sql name="id" type="integer" />
</field>
<field name="group" type="myapp.ProductGroup">
<sql name="group_id" />
</field>
<field name="details" type="myapp.ProductDetail" collection="vector">
<sql many-key="prod_id"/>
</field>
<field name="detailsasc" type="myapp.ProductDetail" collection="vector">
<sql many-key="asc_prod_id"/>
</field>
</class>
and my table ProductDetail looks like:
PROD_DETAIL(ID , NAME, PROD_ID, ASC_PROD_ID)
The problem is that when I insert the tuple (1, 'essai', 1, null) for
example in this table when I load the product one my two vectors details and
detailasc are empty.
So can I do this with castor? Is there a limitation for such things? Am I
doing something wrong?
I'm using castor 0.9.3 (i can send to you my code if you want).
Thanks a lot for your help.
-----Message d'origine-----
De : Oleg Nitz [mailto:[EMAIL PROTECTED]]
Envoy� : mardi 7 ao�t 2001 02:20
� : [EMAIL PROTECTED]
Objet : Re: [castor-dev] Bug in generated SQL?
Cedric,
AFAIK it's not a known bug, but it looks like a bug.
The ordinary tests doesn't show it :(
Can you please send your test to me?
Oleg
On Monday 06 August 2001 174:44, CORMONT C?dric wrote:
> Hi,
>
> I have a problem with this example:
>
> //Classes
> Class FamilyInfos {
> String fi_id
> Vector ascending
> Vector descendant
> }
>
> Class Family {
> String family_id
> }
>
> //TABLES
> FAMILY (FAMILY_ID VARCHAR, ASCENDING_FI_ID VARCHAR, DESCENDANT_FI_ID
> VARCHAR)
> FAMILYINFOS (FI_ID)
>
>
> <class name="FamilyInfos" identity="fi_id" key-generator="UUID">
> <map-to table="FamilyInfos"/>
> <field name="fi_id" type="string">
> <sql name="fi_id" type="varchar" dirty="ignore"/>
> </field>
> <field name="ascending" type="Family" collection="vector">
> <sql dirty="ignore" many-key="ascending_fi_id"/>
> </field>
> <<field name="descendant" type="Family" collection="vector">
> <sql dirty="ignore" many-key="descendant_fi_id"/>
> </field>
> </class>
>
> and when I try to load FamilyInfos I've the following exception:
>
> java.sql.SQLException: Table not found: NULL in statement [SELECT
> Family.family_id,Family.family_id FROM FamilyInfos LEFT OUTER JOIN
> Family ON FamilyInfos.fi_id=Family.ascending_fi_id LEFT OUTER JOIN null
> Family ON FamilyInfos.fi_id=Family.descendant_fi_id WHERE
> FamilyInfos.fi_id='010078010011099710136567100001']
>
> Is it a known bug? Can I do such things with Castor?
>
> Thanks, cedric.
>
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
> unsubscribe castor-dev
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev