Dear all,
I am new to hibernate and have only been working on this for 2 months or so. Recently I hit this problem which I feel really strange. The following is my code :
Code:
String queryStr = "SELECT a.assignmentID, a.assignmentName, a.assignmentStatus, b.accountCompany " +
"FROM Assignment a INNER JOIN Account b " +
"ON a.assignmentClient = b.accountID " +
"WHERE b.accountRole = 3 AND b.accountID = 10";
Session session = HibernateUtil.getSession(getSessionFactoryNumber());
List<Object[]> query = session.createSQLQuery(queryStr)
.list();
for(Object[] o : query){
for(Object oo : o){
System.out.println(oo.toString());
}
}
The SQL code, if run on SQL client, will return the following
6;"Put Your Hands";1;"M. Brown"
Yet on the printing, it shows only the first character of each column, ie:
6,P,1,M
does anyone know the reason for this? Thank you!