Jump to content
Changes to the Jaspersoft community edition download ×

new jasper hibernate support


Recommended Posts

By: Alexandre Torres - alexandretorres

new jasper hibernate support

2006-03-02 04:40

Hi.

I'm glad to see that the new version will have specific support to hibernate queries. I've checked out the CVS version to take a better look, and It was far more than I expected. Can I ask you some questions about it in my "first impression" look?

1. The AbstractQueryExecuter may be extended to other Object query languages? This is cool.

2. I implemented a semi-recursive parameter evaluation. So I can put {P} parameters inside !{P} dynamic query. Is it possible to me contribute with this in some way?

3. I implemented a subreport based on hibernate that uses a collection from the master bean as input. Them the user can bind a filter query (look at Hibernate filter method on session class) to the collection to change the criteria. This is interesting to enable a more object oriented view of model (rather than the traditional Relational Set view of SQL-HQL) keeping the power of the query language. You don't need to express the subreport passing the master bean as parameter.

 

I have this done already as a JRDataSource, and I want to port it as a new JRHibernateAbstractDataSource subclass. What do you think about ?

Please take a look here (search the subreport section) to a some explanation of some of the extensions we implemented on ireport+jasper, I'm going to help ireport dev to support the new hibernate mechanism.

 

http://jtri.sourceforge.net/en/report/ireportHibernate.html

 

Thanks

 

 

By: Lucian Chirita - lucianc

RE: new jasper hibernate support

2006-03-02 12:28

Hi

 

Hibernate/custom query language support is already present in JR 1.2.0, which was released a couple of weeks ago. You could also check out iReports 1.2.0, it features built-in Hibernate support.

 

I'll try to answer your questions:

 

1. Custom query languages are supported via QueryExecuter implementations, which can extend AbstractQueryExecuter to benefit from its code. A query executer factory for a custom language is registered using JR properties.

 

2. We obviously welcome contributions. You can upload a patch here on SF and we'll check it out.

 

3. The Hibernate query executer was intended to have support for collection queries; the code is actually written (the HIBERNATE_FILTER_COLLECTION parameter was meant to hold the collection to filter) but a Hibernate bug made this feature unusable. The bug is caused by Query.getReturnTypes/Aliases failing for filter queries. The bug is logged here:

http://opensource2.atlassian.com/projects/hibernate/browse/HHH-1228

 

We need this reflection information due to the field mapping mechanism (the fields can be mapped using select aliases). I think that what we could do is to support only simple mappings (no aliases) for collection filter queries. I'll look into this and hopefully implement it so that it will be available in the next release.

 

 

I'll check out your Hibernate data source implementation. In the meantime, let me know whether you have any other suggestion/question.

 

Thank you,

Lucian

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

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...