Hi Rick,
this is very easy:
OJB.properties determines which PersistentField implementation is used.
0.9.7 defaults to PersistentFieldPropertyImpl (getter/setter)
CVS HEAD defaults to PersistentFieldDefaultImpl (direct field access)
please check OJB.properties for details.
cheers,
Thomas
"Ask not what I can do for you. Ask what you can do for me."
- Jerry Seinfeld
Rick Sanderson wrote:
Using 0.9.7, OJB was recognizing class fields by getter/setter only.
It would report an error when only a member existed, as follows:
[org.apache.ojb.broker.accesslayer.JdbcAccess] ERROR:
PersistenceBrokerException
during the execution of materializeObject: Error creating PersistentField:
com.enservia.entour.product.Product, categoryID
Error creating PersistentField: com.enservia.entour.product.Product,
categoryID
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
...
Caused by: org.apache.ojb.broker.metadata.MetadataException: Can't find
property categoryID in com.enservia.entour.product.Product
at
org.apache.ojb.broker.metadata.PersistentFieldPropertyImpl.findPropertyDescr
iptor(Unknown Source)
at
org.apache.ojb.broker.metadata.PersistentFieldPropertyImpl.<init>(Unknown
Source)
... 16 more
In my class Product, I do have a private (tried public) member called
categoryID.
If I add getter/setter, it works.
I then updated to the source from cvs (version 0.9.8). The absolute reverse
is true.
OJB now only recognizes member variables in the class, and not
getters/setters.
When only getter/setters appear in the class, an error very similar to the
above results.
As Seinfeld might say... What's up with that?
Since I can find no other posts on the mailing lists on this subject, I fear
I have some kind of invalid setup, but I can't for the life of me figure out
what it is.
/rick.
--
To unsubscribe, e-mail: <mailto:ojb-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:ojb-user-help@;jakarta.apache.org>
--
To unsubscribe, e-mail: <mailto:ojb-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:ojb-user-help@;jakarta.apache.org>