Hi,
How OJB sets and gets attributes/properties from an object is configured in
the OJB.properties file.

I believe the default is to use direct access to the attributes; other
strategies are available and 
listed in the file, including using getters/setters .

The relevant key is PersistenFieldClass :
PersistentFieldClass=org.apache.ojb.broker.metadata.fieldaccess.PersistentFi
eldDirectAccessImpl

HTH

Charles.

>-----Original Message-----
>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
>Sent: 14 August 2003 11:16
>To: [EMAIL PROTECTED]
>Subject: how do you set bean properties when loading a object ?
>
>
>Hi,
>
>i have some problems loading object from the database. i have 
>a class that
>looks like :
>
>class Order 
>{
>   protected Long id;
>   protected String name;
>   protected String something;
>
>  public void setId (Long id) { this.id = id; }
>  public void setName (String name { this.name = name; }
>  public void setAnything (String s) { something = anything; }
>
>  public Long getid () { return id; }
>  public String getName () { return name; }
>  public Strin getAnything () { return something; }
>}
>
>loading and storing works fine if i remove the something 
>property from the
>class descriptor.
>However if i add it to the class descriptor, loading does not 
>work anymore ?
>I always thought the properties are set using the setter 
>methods, but that
>seems not
>to be the case. removing all setters has no influence on 
>loading the object.
>the properties
>are set correctly even if the setters are missing. 
>
>So my question is how do you set the
>properties if you do not need the setter (sorry, this question 
>is a little
>bit off topic) ?
>
>Is there a may to force ojb to use the setters ?
>
>since i want the setter to be called, because
>for some properties i need to have some special code to handle the
>properties (looks
>like the anything setter/getter and something property, but 
>not exactely).
>
>thanks in advance,
>
> Andreas
>
>
>
>
>
>
>-- 
>COMPUTERBILD 15/03: Premium-e-mail-Dienste im Test
>--------------------------------------------------
>1. GMX TopMail - Platz 1 und Testsieger!
>2. GMX ProMail - Platz 2 und Preis-Qualit�tssieger!
>3. Arcor - 4. web.de - 5. T-Online - 6. freenet.de - 7. 
>daybyday - 8. e-Post
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>


This email and any attachments are strictly confidential and are intended
solely for the addressee. If you are not the intended recipient you must
not disclose, forward, copy or take any action in reliance on this message
or its attachments. If you have received this email in error please notify
the sender as soon as possible and delete it from your computer systems.
Any views or opinions presented are solely those of the author and do not
necessarily reflect those of HPD Software Limited or its affiliates.

 At present the integrity of email across the internet cannot be guaranteed
and messages sent via this medium are potentially at risk.  All liability
is excluded to the extent permitted by law for any claims arising as a re-
sult of the use of this medium to transmit information by or to 
HPD Software Limited or its affiliates.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to