Can't comment on your first questions.
However, with respect to using setter methods
versus accessing attributes directly: this
is configurable in the OJB.properties file.

Change:
PersistentFieldClass=org.apache.ojb.broker.metadata.PersistentFieldDefaultImpl
To:
PersistentFieldClass=org.apache.ojb.broker.metadata.PersistentFieldPropertyImpl
and it should work.

Shannon Hardt


-----Original Message-----
From: Gary A. Bartlett [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 25, 2002 10:05 AM
To: OJB Users List
Subject: More Questions - Joins and Setter Methods


Using tutorial 3 as a guide, I have been able to get a 1:1 join working.
As noted in the documentation, the association is implemented by adding an
additional attribute to the first persistent object.  This additional
attribute has the type of the second persistent object.

Looking at the log, I see two queries, first a query against the table
associated with the first persistent class, and then a query against the
second table.  This second query has a where clause as follows:

    WHERE CORPORATEMAP_ID = ?

I am wondering if this query is returning all rows for this table, or is it
just returning the rows that satisfy the foreign keys in the results set
from the first query.

The second question I have is whether it is possible to flatten attributes
via a join.  What I would like to do is have an simple attribute in the
first class that is actually resolved via the join.  In this case the first
(and only) query would include the join and return the joined attribute.
Apologies if this description is not clear, let me know if more
clarification is needed.

Finally, I noticed that OJB does not use the setter methods in the
persistent class to set the instance variables.  Instead it seems to
directly access the instance variables themselves.  Is this normal behavior,
or is it due to something odd in my configuration.

Thanks,

Gary Bartlett


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


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

Reply via email to