User: danch
Date: 01/05/30 15:47:49
Modified: src/main/org/jboss/ejb/plugins/jaws/jdbc Tag: Branch_2_2
JDBCCommand.java
Log:
Fixed bug #424059 - CMP field of type object fails
Revision Changes Path
No revision
No revision
1.30.2.1 +27 -23 jboss/src/main/org/jboss/ejb/plugins/jaws/jdbc/JDBCCommand.java
Index: JDBCCommand.java
===================================================================
RCS file:
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/jaws/jdbc/JDBCCommand.java,v
retrieving revision 1.30
retrieving revision 1.30.2.1
diff -u -r1.30 -r1.30.2.1
--- JDBCCommand.java 2001/03/26 15:19:36 1.30
+++ JDBCCommand.java 2001/05/30 22:47:48 1.30.2.1
@@ -57,7 +57,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Justin Forder</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Dirk Zimmermann</a>
- * @version $Revision: 1.30 $
+ * @version $Revision: 1.30.2.1 $
*/
public abstract class JDBCCommand
{
@@ -405,7 +405,7 @@
if(result == null)
return null;
- if(destination.isAssignableFrom(result.getClass()))
+ if(destination.isAssignableFrom(result.getClass()) &&
!result.getClass().equals(MarshalledObject.class) )
return result;
else if(debug)
log.debug("Got a "+result.getClass().getName()+": '"+result+"' while
looking for a "+destination.getName());
@@ -455,28 +455,32 @@
// ejb-reference: get the object back from the handle
if (result instanceof Handle) result =
((Handle)result).getEJBObject();
- if(!destination.isAssignableFrom(result.getClass())) {
- boolean found = false;
- if(destination.isPrimitive()) {
- if((destination.equals(Byte.TYPE) && result instanceof
Byte) ||
- (destination.equals(Short.TYPE) && result instanceof
Short) ||
- (destination.equals(Character.TYPE) && result instanceof
Character) ||
- (destination.equals(Boolean.TYPE) && result instanceof
Boolean) ||
- (destination.equals(Integer.TYPE) && result instanceof
Integer) ||
- (destination.equals(Long.TYPE) && result instanceof
Long) ||
- (destination.equals(Float.TYPE) && result instanceof
Float) ||
- (destination.equals(Double.TYPE) && result instanceof
Double)
- ) {
- found = true;
- }
- }
- if(!found) {
- log.debug("Unable to load a ResultSet column into a
variable of type '"+destination.getName()+"' (got a "+result.getClass().getName()+")");
- result = null;
- }
- }
+ // is this a marshalled object that we stuck in earlier?
+ if (result instanceof MarshalledObject &&
!destination.equals(MarshalledObject.class))
+ result = ((MarshalledObject)result).get();
+
+ if(!destination.isAssignableFrom(result.getClass())) {
+ boolean found = false;
+ if(destination.isPrimitive()) {
+ if((destination.equals(Byte.TYPE) && result instanceof Byte) ||
+ (destination.equals(Short.TYPE) && result instanceof Short)
||
+ (destination.equals(Character.TYPE) && result instanceof
Character) ||
+ (destination.equals(Boolean.TYPE) && result instanceof
Boolean) ||
+ (destination.equals(Integer.TYPE) && result instanceof
Integer) ||
+ (destination.equals(Long.TYPE) && result instanceof Long) ||
+ (destination.equals(Float.TYPE) && result instanceof Float)
||
+ (destination.equals(Double.TYPE) && result instanceof
Double)
+ ) {
+ found = true;
+ }
+ }
+ if(!found) {
+ log.debug("Unable to load a ResultSet column into a variable
of type '"+destination.getName()+"' (got a "+result.getClass().getName()+")");
+ result = null;
+ }
+ }
- ois.close();
+ ois.close();
} catch (RemoteException e) {
throw new SQLException("Unable to load EJBObject back
from Handle: " +e);
} catch (IOException e) {
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development