db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jakob Braeuchi <jbraeu...@gmx.ch>
Subject Re: Patch for BrokerHelper
Date Fri, 17 Oct 2003 11:39:40 GMT
hi andrew,

thanks for the patch. i just checked it in.

jakob

Clute, Andrew wrote:

> Doesn't like .patch attachments...
>  
>  
> here is the patch
>  
>  
> Index: BrokerHelper.java
> ===================================================================
> RCS file:
> /home/cvspublic/jakarta-ojb/src/java/org/apache/ojb/broker/util/BrokerHelper
> .java,v
> retrieving revision 1.25
> diff -u -r1.25 BrokerHelper.java
> --- BrokerHelper.java 18 Jul 2003 17:23:12 -0000 1.25
> +++ BrokerHelper.java 16 Oct 2003 21:12:25 -0000
> @@ -294,7 +294,9 @@
>    */
>   protected Object getAutoIncrementValue(FieldDescriptor fd, Object obj,
> Object cv)
>   {
> -  if ((cv == null) || ((cv instanceof Number) && (((Number) cv).intValue()
> == 0)))
> +  if ((cv == null) || 
> +     ((cv instanceof Number) && (((Number) cv).intValue() == 0)) || 
> +     ((cv instanceof String) && (((String) cv).length() ==0))) 
>    {
>     PersistentField f = fd.getPersistentField();
>     try
> 
> 
> -----Original Message-----
> From: Clute, Andrew [mailto:Andrew.Clute@osn.state.oh.us] 
> Sent: Thursday, October 16, 2003 5:17 PM
> To: 'ojb-dev@db.apache.org'
> Subject: Patch for BrokerHelper
> 
> 
> 
> Attached is a patch for BrokerHelper.java. 
> 
> The change is a simple one .. When attempting to get the next
> AutoIncrementValue -- if the current value is a String, the new code checks
> to makes sure if the  String is of zero length it still attempts to get the
> value.
> 
> Otherwise, a String of 0 length ends up becoming the PK -- which really
> isn't valid. 
> 
> -Andrew 
> 
> <<BrokerHelper.patch>> 
> 
> 


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