Jump to content
Changes to the Jaspersoft community edition download ×

Hibernate JRCollectionDataSource


2004 IR Help

Recommended Posts

By: bartemmen - bartemmen

Hibernate JRCollectionDataSource

2005-05-03 01:05

Hi Jasper Experts,

 

I have a question.

When i retrieve an object from hibernate it looks like:

 

relationBean which has a Set of AdresBean.

 

How can I do this. Do i have to use a subreport?

I looked had hibernate.org where they have posted a HibernateQueryDataSource class but this one only work for a relationBean which has a AdresBean but not a Set of AdresBean.

 

Anybody suggestions?

 

 

 

 

 

 

By: Teodor Danciu - teodord

RE: Hibernate JRCollectionDataSource

2005-05-04 00:41

 

Hi,

 

If you have a collection of RelationBean and each

RelationBean has a set of AdresBean, then you should

have in your master report a field of type Object that

has the same name as the Set property of the

RelationBean object.

Then, to your subreport, you will pass this as data source:

 

new JRBeanCollectionDataSource((Set)mySetField)

 

This way, for each RelationBean in the master report

data source, the subreport will iterate through the

set of AdresBean objects.

 

I hope this helps.

Teodor

Link to comment
Share on other sites

  • 5 months later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...