You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by An...@gmx.de on 2003/08/14 12:15:46 UTC

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: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org