Hi,
 
I have a problem mapping Java object to Customer Java datatype like this.
 
1. How can I make a reference key in table B to the id in table A?
2. org.exolab.castor.mapping.MappingException: No convertor exists for converting type ...
this is the error i get for mapping datatype A to integer, how to create my own converter?  
 
//datatype A
public class A {
 
    private String _a;
    private String _b;
 
    //getter and setter here
    //...  
   
}
 
//datatype B
public class B {
   
    private A _a;
    private String _b;
 
    //getter and setter here
    //...
}
 
//DDL
create table A
(
  id        int           not null,
  a varchar(200)  not null,
  b varchar(200) not null
);
 
create table B
(
    id int not null,
    a int not null,
    b varchar(200) not null
);
 
<?xml version="1.0" encoding="UTF-8"?>
<mapping>
    <class identity="id" key-generator="IDENTITY" name="B">
        <map-to table="B"/>
        <field name="a" type="A">
            <sql name="a" type="integer"/>
        </field>
        <field name="b" type="string">
            <sql name="b" type="char"/>
        </field>
    </class>
</mapping>
 
thanks for help...
 
 
Cheers,
Ng Keng Yap
        
----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-user

Reply via email to