ncthuc / hibernate-generic-dao

Automatically exported from code.google.com/p/hibernate-generic-dao
0 stars 0 forks source link

SearchToQLProcessor doesn't watch for @Embedded #19

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create an Entity that has an Embedded property
2. Create a search on that Entity with a filter on a property on the
Embedded object.
3. Run the search.

What is the expected output? What do you see instead?
Expected output would be a valid query.  As written, it generates a
NullPointerException in HqlSqlWalker (sorry, don't have the specific stack
trace anymore).  The SearchToQLProcessor is thinking that the Embedded
class needs to be aliased, which it isn't.

What version of the product are you using? On what operating system?
0.3.2 on both Linux and Windows (Java 1.6, Hibernate 3.2.6 and 3.3.1)

Please provide any additional information below.
Not a real easy fix to this.  I'm currently doing some reflection to see if
the property is embedded, however you could also put the onus on the
creator of the filter to specify if this is an embedded property.

Original issue reported on code.google.com by morge...@gmail.com on 15 Dec 2008 at 9:41

GoogleCodeExporter commented 8 years ago
The problem seems to be that SearchToQLProcessor (now called SearchProcessor) 
assumes 
every property is a separate "table" and uses a left join to add it to the 
query. 
With components, there is no table so the query fails.

Original comment by dwolvert on 17 Dec 2008 at 4:02

GoogleCodeExporter commented 8 years ago
I believe the problem has now been fixed. The fix is in the source code now and 
will 
be released with 0.3.5.

Thanks for the error report. Let me know if the fix doesn't work for you.

Original comment by dwolvert on 17 Dec 2008 at 7:08

GoogleCodeExporter commented 8 years ago

Original comment by dwolvert on 5 Jan 2009 at 2:51