[hibernate-issues] [Hibernate-JIRA] Commented: (ANN-816) @Where annotation doesn't work for *-To-One kind of relations when non-lazy fetch

Roman Pokhodzhai (JIRA) noreply at atlassian.com
Sun Apr 5 13:13:38 EDT 2009


    [ http://opensource.atlassian.com/projects/hibernate/browse/ANN-816?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=32797#action_32797 ] 

Roman Pokhodzhai commented on ANN-816:
--------------------------------------

These is a wicked method which generates JOIN condition

public String getOnCondition(String alias, SessionFactoryImplementor factory, Map enabledFilters)
	throws MappingException {
		if ( isReferenceToPrimaryKey() ) { //TODO: this is a bit arbitrary, expose a switch to the user?
			return "";
		}
		else {
			return getAssociatedJoinable( factory ).filterFragment( alias, enabledFilters );
		}
	}


> @Where annotation doesn't work for *-To-One kind of relations when non-lazy fetch
> ---------------------------------------------------------------------------------
>
>                 Key: ANN-816
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-816
>             Project: Hibernate Annotations
>          Issue Type: Bug
>          Components: binder
>    Affects Versions: 3.3.1.GA
>            Reporter: Roman Pokhodzhai
>
> When mapping contain ManyToOne relation and EAGER fetch(SELECT/JOIN) "where" annotation is not taken into account.
> The same for OneToOne annotations where "mappedBy" is not specified
> org.hibernate.type.EntityType has uniqueKeyPropertyName property.
> When this property is NULL(for ManyToOne is always NULL) then "where" condition is not applied.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list