Hi Thomas,
> Hi all
>
> When trying to create my first mapping I had some problems
> where I am not
> sure if I am missunderstanding the model / constraints or if
> this is the way
> you have to do it. Could anyone tell me if the following
> assumptions are
> correct:
>
> - For every mapped attribute there have to be a pair of get /
> set method
> with the naming convention: getATTRIBUTNAME
> - Accesssors have to be public and can't be protected
This is only true if you are using the PersistentFieldPropertyImpl that
relies on JavaBeans conventions. You can tell OJB to use other field access
strategies that access attribute directly via reflection without any
getter/setter methods.
(see OJB.properties for details)
> - Every object needs to have a zero arg. constructor.
> - this constructor has to be public
Correct!
>
> When I am having the following class scenario:
> public abstract class A
> {
> int aAttribute
> }
>
> public class B extends A
> {
> int bAttribute
> }
>
> - I have to create an entry in the repository file for the
> abstract class A,
> and define B as an extend.
You only have to define A in the repository if you want to perform queries
against the base class that is expected to find instances from all classes
extending A.
> - I have to add the mapping for the attribute aAttribute of
> class A to the
> mapping of class B. So I can't exactly model the class structure in
> relation to the attributes.
>
correct.
> - When I want to use dynamic proxies my classes need to
> subclass from an
> interface. This interface has to contain all attribute
> accessors of the
> object...
correct.
cheers,
Thomas
> Please correct me and give me some advices to find a hand
> full of rules for
> the development team
>
> Tom
>
>
>
> ------------------------------------------------------------------
> Thomas H�sler * TietoEnator Consulting AG
> Industriestrasse 19 * 8304 Wallisellen * Switzerland
> Tel. +41 (43) 233 45 28 * Fax +41 (43) 233 45 10
> Mobile +41 (78) 622 03 36
> <mailto:Thomas.Huesler@;TietoEnator.com>
> http://www.tietoenator.ch
>
>
>
>
--
To unsubscribe, e-mail: <mailto:ojb-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:ojb-user-help@;jakarta.apache.org>