Hi again Rick,

Rick Sanderson wrote:
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)
No, it's a global setting, you are expected to choose one approach for all your persistent classes.


If not, would you be interested in an implementation
that does it?  To use OJB effectively, I will need
this flexibility.
You are the first to ask for this feature. Why is it so important for you?

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 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.findPro
pertyDescr

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>


--
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>

Reply via email to