You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by "Nikesh, Kishlay" <ki...@fidelity.co.in> on 2006/03/13 10:20:52 UTC
Problem in using complex objects in ibatis2.0
Hi,
I am having a java-class(getter/setter) which has a reference of another
java class in it.
public class universeVO implements Serializable
{
private int universeid;
private String description;
private weightingHistoryVO wHistVO;
}
Each universeId in the above class can have multiple
weightingHistoryVOs.
I have used the following entries in my Universe.xml file :-
<typeAlias alias="universe" type="com.asset.universeVO"/>
<typeAlias alias="weight" type="com.asset.weightingHistoryVO"/>
<resultMap id="getUniverseResult" class="universe">
<result property="universeid" column="UniverseId" />
<result property="wHistVO.universeid" column="UniverseId" />
</resultMap>
<statement id="getAllUniverse" parameterClass="int"
resultMap="getUniverseResult">
SELECT * from aaUniverse, aaWeightingHistory WHERE
aaUniverse.UniverseId=aaWeightingHistory.UniverseId
AND aaUniverse.UniverseId = #universeid#
</statement>
The above code when used gives me this error on WAS/Sybase environment -
Caused by:
com.ibatis.common.beans.ProbeException: There is no WRITEABLE property
named 'wHistVO' in class 'com.asset.universeVO'
at
com.ibatis.common.beans.ClassInfo.getSetterType(ClassInfo.java:174)
at
com.ibatis.common.beans.GenericProbe.getClassPropertyTypeForSetter(Gener
icProbe.java:250)
Can anyone please advice what could be the problem ?
Many Thanks,
Kishlay Kumar Nikesh
Important: Any comments or statements made in this email are not
necessarily those of Fidelity Business Services India Pvt. Ltd. or any
of the Fidelity group companies. The information transmitted is intended
only for the person or entity to which it is addressed and may contain
confidential and/or privileged material. if you have received this in
error, please contact the sender and delete the material from any
computer. All e-mails sent from or to Fidelity Business Services India
Pvt. Ltd. may be subject to our monitoring procedures.
Re: Problem in using complex objects in ibatis2.0
Posted by Larry Meadors <lm...@apache.org>.
On 3/13/06, Prashanth Sukumaran <pr...@yahoo.com> wrote:
> It is not the problem with iBatis. You cannot have the member variable with
> the second letter Capital.
Sure you can. The mutators getsProperty and setsProperty define a
property named "sProperty"...it's just a bad idea, IMO. :-)
Larry
Re: Problem in using complex objects in ibatis2.0
Posted by Larry Meadors <lm...@apache.org>.
On 3/13/06, Meindert <me...@pastelebusiness.com> wrote:
> Did look at your properties names? If the second letter is a capital then
> the first letter of the property is also a capital;
Almost - according to the spec and the JDK, if the second letter is a
capital then the name after "get" of "set" is *unchanged*:
getsTest() / setsTest = sTest
getITest() / setITest = ITest
Here is a handy snippet of code:
---
public void testProperties() throws Exception {
BeanInfo bi = Introspector.getBeanInfo(TestBean.class);
PropertyDescriptor[] pd = bi.getPropertyDescriptors();
for(int i=0; i < pd.length; i++){
System.out.println(pd[i].getName());
}
}
---
Larry
Re: Problem in using complex objects in ibatis2.0
Posted by Prashanth Sukumaran <pr...@yahoo.com>.
Hi Kishlay
It is not the problem with iBatis. You cannot have the member variable with the second letter Capital.
Instead of wHistVO try whistVO. This will work.
The getter and setter would be getWhistVO and setWhistVO.
Thanks
Prashanth.
"Nikesh, Kishlay" <ki...@fidelity.co.in> wrote:
Hi,
I am having a java-class(getter/setter) which has a reference of another java class in it.
public class universeVO implements Serializable
{
private int universeid;
private String description;
private weightingHistoryVO wHistVO;
}
Each universeId in the above class can have multiple weightingHistoryVOs.
I have used the following entries in my Universe.xml file :-
<typeAlias alias="universe" type="com.asset.universeVO"/>
<typeAlias alias="weight" type="com.asset.weightingHistoryVO"/>
<resultMap id="getUniverseResult" class="universe">
<result property="universeid" column="UniverseId" />
<result property="wHistVO.universeid" column="UniverseId" />
</resultMap>
<statement id="getAllUniverse" parameterClass="int" resultMap="getUniverseResult">
SELECT * from aaUniverse, aaWeightingHistory WHERE
aaUniverse.UniverseId=aaWeightingHistory.UniverseId
AND aaUniverse.UniverseId = #universeid#
</statement>
The above code when used gives me this error on WAS/Sybase environment -
Caused by:
com.ibatis.common.beans.ProbeException: There is no WRITEABLE property named 'wHistVO' in class 'com.asset.universeVO'
at com.ibatis.common.beans.ClassInfo.getSetterType(ClassInfo.java:174)
at com.ibatis.common.beans.GenericProbe.getClassPropertyTypeForSetter(GenericProbe.java:250)
Can anyone please advice what could be the problem ?
Many Thanks,
Kishlay Kumar Nikesh
Important: Any comments or statements made in this email are not necessarily those of Fidelity Business Services India Pvt. Ltd. or any of the Fidelity group companies. The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. if you have received this in error, please contact the sender and delete the material from any computer. All e-mails sent from or to Fidelity Business Services India Pvt. Ltd. may be subject to our monitoring procedures.
---------------------------------
Yahoo! Mail
Bring photos to life! New PhotoMail makes sharing a breeze.
RE: Problem in using complex objects in ibatis2.0
Posted by Meindert <me...@pastelebusiness.com>.
Did look at your properties names? If the second letter is a capital then
the first letter of the property is also a capital;
getPostalCode, setPostalCode => Property name = postalCode
getDOB, setDOB => Property Name = DOB
getWistVO, setWHistVO => WHistVO
MEINDERT HOVING
From: Nikesh, Kishlay [mailto:kishlay.nikesh@fidelity.co.in]
Sent: 13 March 2006 11:21 AM
To: user-java@ibatis.apache.org
Subject: Problem in using complex objects in ibatis2.0
Hi,
I am having a java-class(getter/setter) which has a reference of another
java class in it.
public class universeVO implements Serializable
{
private int universeid;
private String description;
private weightingHistoryVO wHistVO;
}
Each universeId in the above class can have multiple weightingHistoryVOs.
I have used the following entries in my Universe.xml file :-
<typeAlias alias="universe" type="com.asset.universeVO"/>
<typeAlias alias="weight" type="com.asset.weightingHistoryVO"/>
<resultMap id="getUniverseResult" class="universe">
<result property="universeid" column="UniverseId" />
<result property="wHistVO.universeid" column="UniverseId" />
</resultMap>
<statement id="getAllUniverse" parameterClass="int"
resultMap="getUniverseResult">
SELECT * from aaUniverse, aaWeightingHistory WHERE
aaUniverse.UniverseId=aaWeightingHistory.UniverseId
AND aaUniverse.UniverseId = #universeid#
</statement>
The above code when used gives me this error on WAS/Sybase environment -
Caused by:
com.ibatis.common.beans.ProbeException: There is no WRITEABLE property named
'wHistVO' in class 'com.asset.universeVO'
at
com.ibatis.common.beans.ClassInfo.getSetterType(ClassInfo.java:174)
at
com.ibatis.common.beans.GenericProbe.getClassPropertyTypeForSetter(GenericPr
obe.java:250)
Can anyone please advice what could be the problem ?
Many Thanks,
Kishlay Kumar Nikesh
Important: Any comments or statements made in this email are not necessarily
those of Fidelity Business Services India Pvt. Ltd. or any of the Fidelity
group companies. The information transmitted is intended only for the person
or entity to which it is addressed and may contain confidential and/or
privileged material. if you have received this in error, please contact the
sender and delete the material from any computer. All e-mails sent from or
to Fidelity Business Services India Pvt. Ltd. may be subject to our
monitoring procedures.
--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 268.2.1/279 - Release Date: 10/03/2006
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 268.2.1/279 - Release Date: 10/03/2006