Ok, I've not asked yet: what version of OJB are you using?
Edson Richter
----- Original Message -----
From: Joerg Lensing
To: OJB Users List
Sent: Friday, September 12, 2003 12:14 PM
Subject: Re: dynamci Proxy: ClassCastException with Interfaces
Hi Edson
thanks for your reply. I'm still stuck :-(
Edson Carlos Ericksson Richter wrote:
>I've the two situation in my project. I have a documents table table has a
>fixed structure to all types of documents, and I have different tables for
>different objects, in another (a payment structure).
>
>All that works. I think you must specify that your interfaces extends
>others. The java.io.Serializable ins't necessary to work with OJB (but you
>may need it to work with another tech).
>
>But see. If you make AbstractPersistentIF extends java.io.Seralizable, all
>your interfaces (since they will extends AbstractPersistentIF) will be
>subclasses of java.io.Seralizable.
>
I changed it. No difference!
The problem is, that the proxy-instance get the wrong interfaces for the
class in question.
see eclipse "watch-expression" after this code:
[code]:
Criteria crit = new Criteria();
crit.addEqualTo("id", new Integer(pOID));
Query query = new QueryByCriteria(PartnerPO.class, crit);
PartnerIF partner = (PartnerIF)broker.getObjectByQuery(query);
if (broker.hasClassDescriptor(partner.getClass())) {
tx.lock(partner, org.odmg.Transaction.READ);
}
[watch-expression]:
Class[] "Class[] test = partner.getClass().getInterfaces();"= Class[4]
(id=175)
Class [0]= Class (de.softcon.webcontrol.business.model.PersonIF)
(id=106)
Class [1]= Class
(de.softcon.webcontrol.business.model.AbstractPersistentIF) (id=94)
Class [2]= Class (java.io.Serializable) (id=95)
Class [3]= Class (de.softcon.webcontrol.business.model.PartnerIF)
(id=107)
-----------snip----------
As you can see, the proxy doesn't show the expected interface
"OrganisationIF".
(The field "id" has a table-field value of an OrganisationPO (I know
this is OK, because
before used proxies, this has been OK)
joerg
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.516 / Virus Database: 313 - Release Date: 1/9/2003
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]