[hibernate-issues] [Hibernate-JIRA] Updated: (HHH-2526) Filter and Join together

SK (JIRA) noreply at atlassian.com
Thu Mar 29 09:53:04 EDT 2007


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2526?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

SK updated HHH-2526:
--------------------

    Attachment: Response.hbm.xml
                filter.sql
                Request.hbm.xml

This is my test for the filter...

Please have a look at how the useridFilter can be enabled for a join query as below

	public void testRequest() {
		Session session = factory.openSession();
		Transaction ts = session.beginTransaction();
		session.enableFilter("useridFilter").setParameter("userid", "danny");
		List list = session.createQuery("select req from Response res join res.request req").list();
		Iterator result = list.iterator();
		while (result.hasNext()) {
			Request req = (Request) result.next();
			logger.debug(req.getTxnid() + " " + req.getUserid()+" : "  + req.getChecktype());
		}
		ts.commit();
		session.close();
	}

> Filter and Join together
> ------------------------
>
>                 Key: HHH-2526
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2526
>             Project: Hibernate3
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 3.2.0.cr2
>         Environment: 3.2.0, Oracle 9
>            Reporter: SK
>         Attachments: filter.sql, Request.hbm.xml, Response.hbm.xml
>
>
> Select a, b from
> TableA, TableB
> where TableA.id=TableB.id
> if i enable a filter, the query above works
> but when doing so with join it fails
> select a,b
> from TableA join TableB
> if i try to enable filter now, it will fail

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