Robert,
I've just started evaluating OJB tonight (looks very nice so far - great job
guys!), and I'm having the same problem getting nested classes to work with
0.9.8. Actually, I'm wondering if nested classes are supported in this
release, since there seem to be some issues in dealing with
<field-descriptor name="x->y" ...> mappings, so maybe the code for this was
unfinished at the time of the release?
For example, in
org.apache.ojb.broker.metadata.fieldaccess.PersistentNestedFieldMaxPerforman
ceImpl, it looks to me like the following statement (in getFieldRecursive(),
setNestedObject() and getNestedObject()):
String nestedName = fieldname.substring(index + 1);
Should really be:
String nestedName = fieldname.substring(index + PATH_TOKEN.length());
To correctly skip past the separator "->".
Also, org.apache.ojb.broker.query.Criteria.addEqualTo() (and the other
addXXX() methods, I would guess) is being passed attribute as "x->y" when I
think it should be getting just "x" for nested fields.
org.apache.ojb.broker.metadata.AttributeDescriptorBase.getAttributeName()
has the following in what I downloaded:
public String getAttributeName()
{
//return getPersistentField().getName();
return this.fieldname;
}
Switching the comments so that getPersistentField().getName() is returned
seems to work better. This change is made in CVS, so it at least should be
pretty safe.
These two changes seem to get nested class mappings working, although I have
not tested it extensively so I don't know if something else breaks! Worth a
try to see if it gets you going.
Mark
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>