This one time, at band camp, Esteban Santiago said:
ES>Hello, I'm trying to use Castor jdo with the following configuration:
ES>�
ES>Classes (with getters and setters):
ES>�
ES>����� Assemble
ES>������������ id (integer)
ES>������������ description (String)
ES>������������ components (vector)
ES>�
ES>����� Component
ES>������������ id(integer)
ES>������������ description (string)
ES>������������ location (string)
ES>�
ES>with this tables:
ES>�
ES>��������assemble (id integer, description varchar(50)
ES>������� assemble_component (id_assemble integer, id_component)
ES>������� component (id integer, description varchar(50), location varchar (50));
ES>�
ES>and�the following map:
ES>�<class name="edu.uai.teleprocesamiento.automotriz.Component"
depends="edu.uai.teleprocesamiento.automotriz.Assemble" identity="id">
ES>��� <description>Component</description>
ES>��� <map-to table="component" xml="component"/>
ES>��� <field name="id" type="int">
ES>����� <sql name="id" type="integer"/>
ES>��� </field>
ES>��� <field name="description" type="string">
ES>����� <sql name="description" type="varchar"/>
ES>��� </field>
ES>��� <field name="location" type="string">
ES>����� <sql name="location" type="varchar"/>
ES>��� </field>
ES>��� <field name="serialNumber" type="string">
ES>����� <sql name="serialnumber" type="varchar"/>
ES>�! �� </field>
ES>� </class>�
ES>� <class name="edu.uai.teleprocesamiento.automotriz.Assemble" identity="id
id_component" >
ES>��� <description>Assemble</description>
ES>��� <map-to table="assemble" xml="assemble"/>
ES>��� <field name="id" type="int">
ES>����� <sql name="id" type="integer"/>
ES>��� </field>
ES>��� <field name="description" type="string">
ES>����� <sql name="description" type="varchar"/>
ES>��� </field>
ES>��� <field name="components" type="edu.uai.teleprocesamiento.automotriz.Component"
collection="vector">
ES>����� <sql many-key="id_component"/>
ES>��� </field>
ES>� </class>
ES>�The problem is that� Castor never fills the bridge table.
Esteban,
I notice that your objects do not have Collections for the opposing object
(although there is one mapped in the Assemble mapping - weird). Also,
the Component object mapping does not contain a Collection of Assemble
objects. Additionally, the Collection mapping that does exist in the
Component object doesn't contain a 'many-table' attribute in the <sql>
element.
Being that there are many small pieces missing in your example,
I HIGHLY suggest that you take a look at the JDO examples in
src/examples/jdo. These are available via a source download or via CVS.
Bruce
--
perl -e 'print unpack("u30","<0G)[EMAIL PROTECTED]&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");'
The Castor Project
http://www.castor.org/
Apache Geronimo
http://incubator.apache.org/projects/geronimo.html
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev