Has anybody ever seen a Transformer.aliasToBean change the value of an int field being returned from a session.createSQLQuery call ?
I have the following in a POJO:
List resultList = session.createSQLQuery(
sqlQuery)
.setResultTransformer(
Transformers.aliasToBean(clientDTO.class))
.list();
which maps the results of the sqlQuery string to the clientDTO class.
The sqlQuery text when run on SQL Server returns:
clientId seqNum clientName rankNumber activeInd
4776 0 Acme, Inc. 60150 N
but when the resultList is populated, rankNumber is set to 54. I've tried this with other records and everytime rankNumber is 54. All other field values are correct.
My mapping file is as follows:
<hibernate-mapping>
<class name="clientDTO">
<id name="clientName" type="string" />
<property name="rankNumber" type="long" />
<property name="activeInd" />
</class>
</hibernate-mapping>
and the clientDTO:
/** profilePk. */
private ProfilePk profilePk = new ProfilePk();
/** clientName. */
private String clientName;
/** rankNumber. */
private int rankNumber;
/** activeInd. */
private char activeInd;
/** products. */
private String products;
//getters and setters
profilePk is built from clientId and seqNum in the setter section and products is populated later by another query.
Anyone know why a value like 60150 is being changed to another value within the aliasToBean call even though the mapping xml declares it as a long (also tries integer and big_integer but no joy) and the class variable in the clientDTO is also an int ?
|