db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Mahler <thm...@web.de>
Subject Re: [PATCH] SequenceManagerMySQLImpl.java
Date Fri, 14 Feb 2003 20:55:05 GMT
done!
thanks for the patch,

Thomas

John M wrote:
> I had a problem where I would get an exception
> because the mySQL sequence manager was trying to get a
> class descriptor from a proxy object, and of course it
> could not be found.  I just used ProxyHelper to get
> the
> right class from the proxy.
> 
> John Marshall
> 
> 
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Shopping - Send Flowers for Valentine's Day
> http://shopping.yahoo.com
> 
> 
> ------------------------------------------------------------------------
> 
> Index: src/java/org/apache/ojb/broker/util/sequence/SequenceManagerMySQLImpl.java
> ===================================================================
> RCS file: /home/cvspublic/db-ojb/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerMySQLImpl.java,v
> retrieving revision 1.7
> diff -u -r1.7 SequenceManagerMySQLImpl.java
> --- src/java/org/apache/ojb/broker/util/sequence/SequenceManagerMySQLImpl.java	5 Feb
2003 20:16:00 -0000	1.7
> +++ src/java/org/apache/ojb/broker/util/sequence/SequenceManagerMySQLImpl.java	13 Feb
2003 15:38:49 -0000
> @@ -17,6 +17,7 @@
>  import org.apache.ojb.broker.PersistenceBroker;
>  import org.apache.ojb.broker.PersistenceBrokerException;
>  import org.apache.ojb.broker.query.Query;
> +import org.apache.ojb.broker.util.ProxyHelper;
>  import org.apache.ojb.broker.accesslayer.JdbcAccess;
>  import org.apache.ojb.broker.accesslayer.ResultSetAndStatement;
>  import org.apache.ojb.broker.metadata.ClassDescriptor;
> @@ -178,9 +179,10 @@
>           && (!(ref instanceof Proxy)))
>           {*/
>  
> +        Class c = ProxyHelper.getRealClass(ref);
>          // get ClassDescriptor for RefDescriptor object
>          ClassDescriptor refCld =
> -                broker.getDescriptorRepository().getDescriptorFor(ref.getClass());
> +                broker.getDescriptorRepository().getDescriptorFor(c);
>          // since there can only be 1 auto_inc column, we don't need to get the whole
set of pkvalues
>          //Object[] refPkValues = refCld.getKeyValues(ref);
>          ClassDescriptor objCld = cld;
> 
> 
> 
> ------------------------------------------------------------------------
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org



Mime
View raw message