You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Charles Anthony <ch...@hpdsoftware.com> on 2003/11/26 16:24:00 UTC

RE: proxy ClassCastException

You must cast to InterfaceNotaRecibo not NotaRecibo.


> -----Original Message-----
> From: Glauber Andrade [mailto:glauber@maximasti.com.br]
> Sent: 26 November 2003 15:28
> To: ojb-user@db.apache.org
> Subject: proxy ClassCastException
> Importance: High
> 
> 
> I am trying to use proxy (my first time) and I am getting a
> ClassCastException.
> What do I need to do? How do I cast ?
> Thanks,
> 
> Glauber
> 
> ////////////////////////////////////
>       Query q = QueryFactory.newQuery(NotaRecibo.class, crit);
>       Collection c = broker.getCollectionByQuery(q);
>       Iterator iter = c.iterator();
>       Object[][] data = new Object[c.size()][17];
>       NotaRecibo nota = null;
>       while (iter.hasNext()) {
>          nota = (NotaRecibo) iter.next();    ===> ClassCastException
>          ...
> ////////////////////////////////////
>    <class-descriptor
>       class="com......data.NotaRecibo"
>      proxy="dynamic"
>       table="notasrecibos"
>    >
> ...
> ////////////////////////////////////
> public interface InterfaceNotaRecibo {
> ...
> ////////////////////////////////////
> public class NotaRecibo implements InterfaceNotaRecibo {
> ...
> ////////////////////////////////////
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 


___________________________________________________________
HPD Software Ltd. - Helping Business Finance Business
Email terms and conditions: www.hpdsoftware.com/disclaimer 



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org