Thanks Bruce,
Its working now. I did not know that Castor already knows to use an adder instead of a setter without specifying.
Thanks again.
Avalovin


Bruce Snyder <[EMAIL PROTECTED]> wrote:

This one time, at band camp, Avalivin Jhons said:

AJ>

Avalivin,

I would suggest removing the 'get-method' and 'set-method' attributes
from the element above. Notice, for example, in the Castor JDO examples
that these attributes are not specified for the myapp.Category class
that contains a collection of of myapp.Product objects. Because the
'collection' attribute exists, Castor already knows to use an adder
instead of a setter.

Bruce
--
perl -e 'print unpack("u30","<0G)[EMAIL PROTECTED]&5R\"F9E
The Castor Project
hhttp://www.castor.org/

Apache Geronimo
http://incubator.apache.org/projects/geronimo.html

Sorry for sending it again.  I got stuck because of the error.

 

 

I am getting �no method to set value� ClassMolder� Error and could not find out what is wrong with my code.  I will be help if somebody can have a look over it.

 

 

The Error is :

 

org.exolab.castor.jdo.DataObjectAccessException: no method to set value for field: pack.ReffClass in class: ClassMolder pack.MainClass.

 

 

This is a one-to many case using collection type vector.

In class pack.MainClass  in place of 

public void setReffClass(pack.ReffClass _reffClass){} method, 

I have 

public void addReffClass(pack.ReffClass _reffClass) {} method.

 

This is written in the mapping.xml as

 <class name="pack.MainClass" extends="pack.SupperMainClass" identity="id" key-generator="SEQUENCE"  >

<cache-type cache="count-limited" capacity="1000"/>

<map-to table="TT_MC "/>

<field name="id" type="big-decimal"> <sql name="ID" type="numeric"/>

</field>..

..

 

<field direct="false" name="reffClass" type="pack.ReffClass" get-method="getReffClass" set-method="addReffClass " collection="vector">

<sql many-key="T_MC_ID"/>

</field>

</class>

 

 

 

 The MainClass look like �

 

package pack;

 

public class  MainClass  extends SupperMainClass {

 

public String text;

public String URI;

 

public Vector reffClass = new Vector();

 

 

public Vector getReffClass () {

             return reffClass ;

}

 

 

public void addReffClass (ReffClass  _reffClass) {

            reffClass.add(_reffClass);

}

..

..

}

 

 

 


Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now

Reply via email to