Problem: Using a join in a constructor result, the DTO class is being cast by hibernate to be java.lang.Object
i.e. java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to com...presentation.article.CommentInfoListItemDTO
The code/classes driving this are attached. Also the question is well stated on Stack Overflow... but I really think this is a bug, so am opening an issue. The link to the SO question is listed below.
From the driver file (a JSF Managed Bean) I am calling the code like so: // Instance variables CommentInfoListFacade commentInfoListFacade; List<CommentInfoListItemDTO> commentInfoList; // Inside a @PostConstruct init method @PostConstruct public void init() { commentInfoList = commentInfoListFacade.getCommentTitleListByPersonId(personId); }
Please see the issue on Stack Overflow. I asked the question, but I really think this is more than likely a bug. It explains the issue well, with code examples.
http://stackoverflow.com/questions/26375565/jpa-2-1-constructorresult-causing-classcastexception
Stacktrace, create table, table insert, and source code attached.
|