Hi again Rick, Rick Sanderson wrote:
No, it's a global setting, you are expected to choose one approach for all your persistent classes.Hi Thomas,Doh! Is there a way to overwrite the setting from OJB.properties (DefaultImpl or PropertyImpl) on a field by field basis? (I could not find it in the DTD)
You are the first to ask for this feature. Why is it so important for you?If not, would you be interested in an implementation that does it? To use OJB effectively, I will need this flexibility.
If you contribute an implementation for this feature I will at least include your solution in our contributions package.
cheers,
Thomas
/rick. "Outside of a dog, a book is a man's best friend. Inside of a dog, it's too dark to read." -- anon-----Original Message----- From: Thomas Mahler [mailto:thma@;apache.org] Sent: Tuesday, November 12, 2002 1:28 PM To: OJB Users List Subject: Re: which attribute access behavior is correct? 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 creatingPersistentField:com.enservia.entour.product.Product, categoryID Error creating PersistentField: com.enservia.entour.product.Product, categoryID java.lang.reflect.InvocationTargetException atsun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)... Caused by: org.apache.ojb.broker.metadata.MetadataException: Can't find property categoryID in com.enservia.entour.product.Product atorg.apache.ojb.broker.metadata.PersistentFieldPropertyImpl.findPro pertyDescriptor(Unknown Source) atorg.apache.ojb.broker.metadata.PersistentFieldPropertyImpl.<init>(UnknownSource) ... 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). Theabsolute reverseis true. OJB now only recognizes member variables in the class, and not getters/setters. When only getter/setters appear in the class, an error verysimilar to theabove results. As Seinfeld might say... What's up with that? Since I can find no other posts on the mailing lists on thissubject, I fearI have some kind of invalid setup, but I can't for the life ofme figure outwhat 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>-- 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>
