From: Juergen H. <jho...@us...> - 2006-04-21 00:14:23
|
Update of /cvsroot/springframework/spring/src/org/springframework/orm/hibernate/support In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19629/src/org/springframework/orm/hibernate/support Modified Files: Tag: mbranch-1-2 BlobStringType.java Log Message: backported fixes and enhancements from 2.0 M4 (HEAD) Index: BlobStringType.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/orm/hibernate/support/BlobStringType.java,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** BlobStringType.java 9 Jan 2006 22:46:03 -0000 1.1.2.2 --- BlobStringType.java 21 Apr 2006 00:13:49 -0000 1.1.2.3 *************** *** 1,11 **** /* ! * Copyright 2002-2005 the original author or authors. ! * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at ! * * http://www.apache.org/licenses/LICENSE-2.0 ! * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, --- 1,11 ---- /* ! * Copyright 2002-2006 the original author or authors. ! * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at ! * * http://www.apache.org/licenses/LICENSE-2.0 ! * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, *************** *** 79,84 **** byte[] bytes = lobHandler.getBlobAsBytes(rs, index); ! String encoding = getCharacterEncoding(); ! return (encoding != null ? new String(bytes, encoding) : new String(bytes)); } --- 79,89 ---- byte[] bytes = lobHandler.getBlobAsBytes(rs, index); ! if (bytes != null) { ! String encoding = getCharacterEncoding(); ! return (encoding != null ? new String(bytes, encoding) : new String(bytes)); ! } ! else { ! return null; ! } } *************** *** 86,93 **** throws SQLException, UnsupportedEncodingException { ! String str = (String) value; ! String encoding = getCharacterEncoding(); ! byte[] bytes = (encoding != null ? str.getBytes(encoding) : str.getBytes()); ! lobCreator.setBlobAsBytes(ps, index, bytes); } --- 91,103 ---- throws SQLException, UnsupportedEncodingException { ! if (value != null) { ! String str = (String) value; ! String encoding = getCharacterEncoding(); ! byte[] bytes = (encoding != null ? str.getBytes(encoding) : str.getBytes()); ! lobCreator.setBlobAsBytes(ps, index, bytes); ! } ! else { ! lobCreator.setBlobAsBytes(ps, index, null); ! } } |