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 Robert Glover <ro...@yahoo.com> on 2007/09/28 19:03:54 UTC
vexing (possible) bug in abator
My abator problem is that the last 5 characters of a field are being chopped
off. In the example I show below, those 5 characters are: "5F:E4". This
chopping off only occurs under the conditions shown below. Note the database is
Oracle 10g.
In my java code I have the following:
IavAssetInfo1Example iavAssetInfo1Example = new IavAssetInfo1Example();
iavAssetInfo1Example.createCriteria().andSerialNumEqualTo(serialNum);
List<IavAssetInfo1> list =
getIavAssetInfo1DAO().selectByExample(iavAssetInfo1Example);
if (list.size()>0) {
IavAssetInfo1 iavAssetInfo1 = list.get(0);
System.out.println("IavAssetInfo1
'"+iavAssetInfo1.getMacAddressForDisplay() + "' (size="+list.size() );
}
The print statement prints the following:
SystemOut O IavAssetInfo1 '00:05:9A:3C:78:00, 00:06:25:29:6F:D0,
00:0D:60:60:' (size=1
However, when I use Aqua Data Studio to issue the following query:
select * from iat_Asset where MAC_ADDRESS_FOR_DISPLAY like '%,%'
I get the result shown below. Note the important thing to see below is that
when the MAC_ADDRESS_FOR_DISPLAY for the row corresponding the the print
statement above
is: 00:05:9A:3C:78:00, 00:06:25:29:6F:D0, 00:0D:60:60:5F:E4
the print statement above shows it as :
00:05:9A:3C:78:00, 00:06:25:29:6F:D0, 00:0D:60:60
The chopping off bug does not occur if column MAC_ADDRESS_FOR_DISPLAY has
a single value such as "00:05:9A:3C:78:00", and it does not occur if the column
has a double value such as "00:05:9A:3C:78:00, 00:0D:60:3B:DF:BA". However
the chopping off bug always happens if the column has three values, as in the
example above.
Note also that "IavAssetInfo1" is a view (not a table) with the name
"IAV_ASSET_INFO1" that actually refers to a "LEFT FULL JOIN" or two tables. The
column having the problem is used in the view unmodified from it's value in one
of the tables. In that table it is defined as VARCHAR2(512).
EMP_ID SERIAL_NUM BUDGET_UNIT TIER_PRICE_USAGE_CD
ASSET_COMMENT DECOMM_REQ_FLG MACHINE_NAME LOCATION
MAC_ADDRESS_FOR_DISPLAY
--------- ------------- -------------- ----------------------
----------------------------- ----------------- --------------- -----------
-------------------------------------------------------
033070 99GYZD9 6803 LDR (null)
No B1TXHC0L1 (null)
00:05:9A:3C:78:00, 00:0D:60:3B:DF:BA
099002 DHFPX41 4391 LDR (null)
No B1JCPPIL0 (null)
00:05:9A:3C:78:00, 00:0F:1F:A1:CF:EE, 00:53:45:00:00:00
062348 99GYYB6 6001 LDNR Upgraded to
1 GB memory. No B1DJPANL0 (null)
00:05:9A:3C:78:00, 00:0D:60:39:F0:FC
060106 99GZBN2 6326 LDR (null)
No B1IBOSNL0 (null)
00:05:4E:47:CE:83, 00:0D:60:60:9F:AE
091054 99GZBM8 6405 LDR (null)
No B1XYX01L0 (null)
00:05:9A:3C:78:00, 00:0D:60:60:9E:A7
059661 99ARDZ2 8804 LDR (null)
No B1CJNESL0 (null)
00:05:9A:3C:78:00, 00:0D:60:80:26:A8, 00:53:45:00:00:00
034050 1VT7G41 6476 DTL *DSI device
- 8th Floor Lab* No B1SOHSCD0 (null)
00:0D:56:CC:B7:62, 00:50:56:C0:00:01, 00:50:56:C0:00:08
040516 99GZBA1 6301 LDR (null)
No B1MFKSDL0 (null)
00:05:9A:3C:78:00, 00:06:25:29:6F:D0, 00:0D:60:60:5F:E4
012164 99GZBM3 6405 LDR (null)
No B1JHCIML0 (null)
00:05:9A:3C:78:00, 00:09:5B:E8:C9:D6
9 record(s) selected [Fetch MetaData: 0/ms] [Fetch Data: 0/ms]