Bugs item #1460440, was opened at 2006-03-29 05:25
Message generated for change (Settings changed) made by garpinc
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=700930&aid=1460440&group_id=124910
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
>Status: Open
Resolution: Fixed
Priority: 5
Submitted By: Garry (garpinc)
Assigned to: Nobody/Anonymous (nobody)
Summary: I get error if dest does not have getter?
Initial Comment:
net.sf.morph.transform.TransformationException: Error
copying source Subscribers (class
com.bcbsma.seebeyond.idsuee.elements.SubscriberEligibi
lity$Subscribers) to destination
com.bcbsma.seebeyond.a2a.InsertSubscriberAddress@26f9e
5 (class
com.bcbsma.seebeyond.a2a.InsertSubscriberAddress)
at
net.sf.morph.transform.transformers.BaseTransformer.co
py(BaseTransformer.java:367)
at
com.bcbsma.seebeyond.ids.eligibility.IDSInsertEligibil
ityRecordActivity.performActivity
(IDSInsertEligibilityRecordActivity.java:59)
at
com.eds.seebeyond.common.activity.SeeBeyondActivity.pe
rform(SeeBeyondActivity.java:132)
at
com.bcbsma.seebeyond.ids.eligibility.TestIDSInsertElig
ibilityRecordActivity.testSubscriberEligibility
(TestIDSInsertEligibilityRecordActivity.java:70)
at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke
(Method.java:324)
at junit.framework.TestCase.runTest
(TestCase.java:154)
at junit.framework.TestCase.runBare
(TestCase.java:127)
at junit.framework.TestResult$1.protect
(TestResult.java:106)
at junit.framework.TestResult.runProtected
(TestResult.java:124)
at junit.framework.TestResult.run
(TestResult.java:109)
at junit.framework.TestCase.run
(TestCase.java:118)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner
.runTests(RemoteTestRunner.java:478)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner
.run(RemoteTestRunner.java:344)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner
.main(RemoteTestRunner.java:196)
Caused by: net.sf.morph.reflect.ReflectionException:
The property 'subscriberID' is not readable in bean
com.bcbsma.seebeyond.a2a.InsertSubscriberAddress@26f9e
5 (class
com.bcbsma.seebeyond.a2a.InsertSubscriberAddress)
using reflector SimpleDelegatingReflector
[ListReflector,SortedSetReflector,ArrayReflector,Resul
tSetReflector,ContextReflector,MapReflector,DynaBeanRe
flector,ObjectReflector] (class
net.sf.morph.reflect.reflectors.SimpleDelegatingReflec
tor)
at
net.sf.morph.reflect.reflectors.BaseReflector.get
(BaseReflector.java:603)
at
net.sf.morph.transform.copiers.BasePropertyNameCopier.
copyProperty(BasePropertyNameCopier.java:108)
at
net.sf.morph.transform.copiers.PropertyNameMappingCopi
er.copyImpl(PropertyNameMappingCopier.java:122)
at
net.sf.morph.transform.transformers.BaseTransformer.co
py(BaseTransformer.java:360)
... 16 more
----------------------------------------------------------------------
Comment By: Garry (garpinc)
Date: 2006-03-31 22:15
Message:
Logged In: YES
user_id=712000
I don't have control of my destination object so I would
need morph to look at the source type and prefer that over
object if it exists.
----------------------------------------------------------------------
Comment By: Matt Sgarlata (sgarlatm)
Date: 2006-03-31 19:07
Message:
Logged In: YES
user_id=1161666
Fixed in Morph 1.0.1.
However, there is another problem you are likely to
encounter with your code. The issue is that you have
multiple setters for the subscriberID property. Morph
doesn't really have a good way of determining which one to
use so it's going to pick at random, and it may make the
wrong choice. The solution is to make a single
setSubscriberID(Object obj) method that does a test like this
if (obj instance of String) {
// logic here
}
else {
}
So basically combine your setters into a single setter.
----------------------------------------------------------------------
Comment By: Garry (garpinc)
Date: 2006-03-30 21:18
Message:
Logged In: YES
user_id=712000
As indicated there are no getters for SubscriberID only
setters. Since this is the destination object there should
be no need to have a getter. In my case this is a one way
mapping.
----------------------------------------------------------------------
Comment By: Garry (garpinc)
Date: 2006-03-30 21:14
Message:
Logged In: YES
user_id=712000
package com.bcbsma.seebeyond.a2a;
import java.sql.*;
import com.stc.eways.jdbcx.*;
public class InsertSubscriberAddress extends
PreparedStatementAgent {
public InsertSubscriberAddress(Session session) {
super(session, "INSERT INTO TBL_SUBSCRIBER_ADDRESS
(SUBSCRIBER_ID, GROUP_NUMBER, TYPE_CODE, ADDRESS1,
ADDRESS2, CITY, STATE, ZIP_5, ZIP_4, COUNTRY, PHONE_1,
PHONE_2) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)");
}
public void setSubscriberID(java.lang.String obj)
throws java.sql.SQLException {
if(obj == null)
setNull(1, Types.VARCHAR);
else
setString(1, obj);
}
public void setSubscriberID(Object obj) throws
java.sql.SQLException {
if(obj == null)
setNull(1, Types.VARCHAR);
else
setObject(1, obj);
}
public void setGroupNumber(java.lang.String obj)
throws java.sql.SQLException {
if(obj == null)
setNull(2, Types.VARCHAR);
else
setString(2, obj);
}
public void setGroupNumber(Object obj) throws
java.sql.SQLException {
if(obj == null)
setNull(2, Types.VARCHAR);
else
setObject(2, obj);
}
public void setTypeCode(java.lang.String obj) throws
java.sql.SQLException {
if(obj == null)
setNull(3, Types.VARCHAR);
else
setString(3, obj);
}
public void setTypeCode(Object obj) throws
java.sql.SQLException {
if(obj == null)
setNull(3, Types.VARCHAR);
else
setObject(3, obj);
}
public void setAddress1(java.lang.String obj) throws
java.sql.SQLException {
if(obj == null)
setNull(4, Types.VARCHAR);
else
setString(4, obj);
}
public void setAddress1(Object obj) throws
java.sql.SQLException {
if(obj == null)
setNull(4, Types.VARCHAR);
else
setObject(4, obj);
}
public void setAddress2(java.lang.String obj) throws
java.sql.SQLException {
if(obj == null)
setNull(5, Types.VARCHAR);
else
setString(5, obj);
}
public void setAddress2(Object obj) throws
java.sql.SQLException {
if(obj == null)
setNull(5, Types.VARCHAR);
else
setObject(5, obj);
}
public void setCity(java.lang.String obj) throws
java.sql.SQLException {
if(obj == null)
setNull(6, Types.VARCHAR);
else
setString(6, obj);
}
public void setCity(Object obj) throws
java.sql.SQLException {
if(obj == null)
setNull(6, Types.VARCHAR);
else
setObject(6, obj);
}
public void setState(java.lang.String obj) throws
java.sql.SQLException {
if(obj == null)
setNull(7, Types.VARCHAR);
else
setString(7, obj);
}
public void setState(Object obj) throws
java.sql.SQLException {
if(obj == null)
setNull(7, Types.VARCHAR);
else
setObject(7, obj);
}
public void setZip5(java.lang.String obj) throws
java.sql.SQLException {
if(obj == null)
setNull(8, Types.VARCHAR);
else
setString(8, obj);
}
public void setZip5(Object obj) throws
java.sql.SQLException {
if(obj == null)
setNull(8, Types.VARCHAR);
else
setObject(8, obj);
}
public void setZip4(java.lang.String obj) throws
java.sql.SQLException {
if(obj == null)
setNull(9, Types.VARCHAR);
else
setString(9, obj);
}
public void setZip4(Object obj) throws
java.sql.SQLException {
if(obj == null)
setNull(9, Types.VARCHAR);
else
setObject(9, obj);
}
public void setCountry(java.lang.String obj) throws
java.sql.SQLException {
if(obj == null)
setNull(10, Types.VARCHAR);
else
setString(10, obj);
}
public void setCountry(Object obj) throws
java.sql.SQLException {
if(obj == null)
setNull(10, Types.VARCHAR);
else
setObject(10, obj);
}
public void setPhone1(java.lang.String obj) throws
java.sql.SQLException {
if(obj == null)
setNull(11, Types.VARCHAR);
else
setString(11, obj);
}
public void setPhone1(Object obj) throws
java.sql.SQLException {
if(obj == null)
setNull(11, Types.VARCHAR);
else
setObject(11, obj);
}
public void setPhone2(java.lang.String obj) throws
java.sql.SQLException {
if(obj == null)
setNull(12, Types.VARCHAR);
else
setString(12, obj);
}
public void setPhone2(Object obj) throws
java.sql.SQLException {
if(obj == null)
setNull(12, Types.VARCHAR);
else
setObject(12, obj);
}
int _updateCount;
public int executeUpdate() throws
java.sql.SQLException {
return (_updateCount = super.executeUpdate());
}
public int count() {
return _updateCount;
}
public void addBatch() throws java.sql.SQLException {
super.addBatch();
}
public void clearBatch() throws java.sql.SQLException {
super.clearBatch();
}
public int[] executeBatch() throws
java.sql.SQLException {
return super.executeBatch();
}
}
----------------------------------------------------------------------
Comment By: Matt Sgarlata (sgarlatm)
Date: 2006-03-30 14:44
Message:
Logged In: YES
user_id=1161666
The error message says "'subscriberID' is not readable in bean
com.bcbsma.seebeyond.a2a.InsertSubscriberAddress". Could
you please post the class definition for
InsertSubscriberAddress?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=700930&aid=1460440&group_id=124910
|