Hi everyone.  I searched the archive and didn't find a thread on point.  I
encountered a hibernate type cast issue:

Variation 1:

List<Message> messageList = session.createSQLQuery("select * from Message
where id=1").list();
*message = messageList.get(0);*

The bold-faced line of code throws a "java.lang.ClassCastException:
[Ljava.lang.Object;"

Variation 2:

int messageid = 1;
Criteria crit = session.createCriteria(Message.class);
SimpleExpression se = Restrictions.eq("id", new Integer(messageid));
crit.add(se);
*List<Message> messageList = crit.list();*

The bold-faced line of code throws a "java.lang.ClassCastException:
java.lang.Integer."

Variation 3:

Criteria crit = session.createCriteria(Message.class);
List<Message> messageList = crit.list();
Message currentMessage = messageList.get(0);

No exception is thrown.

I spent hours trying to resolve this issue and am now thoroughly frustrated. 
Any help will be highly appreciated.

Harry


--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/hibernate-type-cast-issue-tp5130777p5130777.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to