java - Is it possible to use a "TypedQuery" as the DataSource of a JasperReport? -


i'm creating report ireport uses jpql datasource

but there's 1 thing don't seem able do. can query work if fields i'm searching known java default, on example:

select p.name person p 

in case map p.name java.lang.string

<field name="name" class="java.lang.string">     <fielddescription><![cdata[column_1]]></fielddescription> </field> 

and voilĂ , works.

but if query this:

select p person p 

and map p com.myproject.person,

<field name="person" class="com.myproject.person">     <fielddescription><![cdata[column_1]]></fielddescription> </field> 

i exception this:

java.lang.classcastexception: com.myproject.person cannot cast [ljava.lang.object;

that tells me can´t cast person array of java.lang.object when wanted result list of person

is there way can run second query? place can set type of result?

i have exported .jar file of project, , added ireport's classpath, works because on reports send list of objects datasource, can use , reference classes fine, jpql it's giving me trouble

has ever done this? or know how it's done?


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -