Hi again Alen.

I think you should define the extent the other way round.
That is: RegisterForm is the abstract base class and User is the concrete class defining all the persistent attributes.


   <class-descriptor class="za.co.alen.struts.RegisterForm">
      <extent-class class-ref="za.co.alen.jfaq.User" />
   </class-descriptor>

   <class-descriptor
     class="za.co.alen.jfaq.User"
     table="User"
   >
     <!-- field mappings -->
     ...
   </class-descriptor>

cheers,
Thomas

Alen Ribic wrote:
Thanks Raymond for your reply.

This is the thing. I am very lost.
The User class descriptor in repository contains all my filed mappings to my
User table in db.
Now za.co.alen.struts.RegisterForm class mapping is a very good question.
What would the za.co.alen.struts.RegisterForm class mapping contain? I don't
need any RegisterForm class specific fields at all.
I just need to indicate to OJB that it needs to something like cast
RegisterForm instance to User and hence would need to map that to User class
/ table mapping. (Remember that the instance I get is of
za.co.alen.struts.RegisterForm)
RegisterForm class does not have any real meaning for persistence besides
the inherited fields from User bean.
It basically just contains overridden validate(...) method used for
server-side validation in my struts components.

I hope this is making sense. :-)

--Alen



----- Original Message -----
From: "Raymond Barlow" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
Sent: Tuesday, June 03, 2003 10:45 AM
Subject: Re: Extent. How to?



Hi Alen

I hate to ask the obvious, but you never know :)
Have you created a mapping for za.co.alen.struts.RegisterForm in your
repository_user.xml file??

Regards,
Raymond Barlow

Alen Ribic wrote:


Hi again

I have sent an email already and got a good reply, but now I have an

issue


with mapping side.

I have got classes as follows:

// JavaBean
public class User extends ValidatorForm {}

// Struts form bean
public class RegisterForm extends User {}

Now I just need OJB to recognize RegisteForm class as a User.

usr = request.getAttribute("registerForm"); // returns RegisteForm

instance


broker.store(usr);

So now, OJB on store(...) should look at mapping for User class to User
table.

<class-descriptor
    class="za.co.alen.jfaq.User"
    table="User"
 >
    <extent-class class-ref="za.co.alen.struts.RegisterForm" />
    <!-- field mappings -->
    ...
 </class-descriptor>

I presume that now I need a <class-descriptor/> for the RegisterForm

class.


Is this correct?
I looked at the Article example but I just can't get my one to work.

My app still says that OJB cannot recognize RegisterForm class in
repository.

What am I doing wrong and how can I go about doing this correctly.

Thanks

--Alen



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





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




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




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



Reply via email to