one-to-one non-lazy loading but Filters Not Applied.

Description

While fetching one-to-one association, filters are not applied.
I have modified the hibernate code to resolve this issue. With these changes, if filters a are enabled for one-to-one associations,
they will be applied (appear in sql) else not.

Changes Done:
A) In EntityJoinWalker.java >> constructor:line 40
Current Code:
StringBuffer whereCondition = whereString( getAlias(), uniqueKey, batchSize )
//include the discriminator and class-level where, but not filters
.append( persister.filterFragment( getAlias(), Collections.EMPTY_MAP ) );

Changed Code:
StringBuffer whereCondition = whereString( getAlias(), uniqueKey, batchSize );
//include the discriminator and class-level where, but not filters
String filter= persister.filterFragment( getAlias(), enabledFilters);
whereCondition.insert( 0, StringHelper.moveAndToBeginning(filter) );

Environment

Hibernate 3.2.6

Activity

Show:
Steve Ebersole
February 2, 2010, 6:11 PM

also filters cannot be applied to many-to-one, you are mistaken

Sandeep Vaid
February 3, 2010, 7:52 AM

Steve,
Assuming our intention is not change in cardinality... The intention is to apply only some conditions (filters) to one-to-one.
What problem do you see in this? Also presently hibernate doesn;t have any way to solve this problem.

Can you please let us know a reason why conditions (filters) can't be applied to one-to-one but can be applied to one-to-many ?

Sandeep Vaid
April 4, 2010, 9:00 PM

Steve,
Can you please answer my query.. i think this feature is required in hibernate.

Steve Ebersole
April 4, 2010, 9:24 PM

Sandeep, please stop. This is getting annoying. I have already answered this on your many private emails in addition to here. I am sorry you do not like the answer. This is not something I will implement. And this is really the last I will respond to it.

Sandeep Vaid
April 5, 2010, 7:39 AM

Steve,
Firstly i am sorry if my questions have troubled you.. My intention was just to help hibernate to improve. Regarding our previous communications, you have replied regarding changing cardinality but you have not yet replied to this query. It's fine with me if you don't want to reply but it would be great if you can redirect me to someone else from hibernate team with whom i can discuss this point in more detail as till today this question is open for me.

Rejected

Assignee

Steve Ebersole

Reporter

Sandeep Vaid

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

Affirmative

Pull Request

None

backportDecision

None

Components

Priority

Major
Configure