Shame. I would have thought that collections and composite entities would actually be easier than mapped objects right?
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Tuna Toksöz Sent: Monday, October 06, 2008 9:15 AM To: [email protected] Subject: [nhibernate-development] Re: FW: [nhusers] Re: Criteria querries and collections No it is not supported in criteria. i am thinking about what can be hard. I don't think there is a jira issue so feel free to create a issue. On Mon, Oct 6, 2008 at 7:01 PM, Jon Palmer <[EMAIL PROTECTED]> wrote: I figured the dev list might be a better place to ask this. Is there a Jira issue for this and if so what is hard about the fix? Thanks Jon P.S. In HQL you can also do this: Session.CreateQuery("from Person p where p.EmailAddresses[0] = '[EMAIL PROTECTED]'").List() Is there an equivalent using the Criteria API? Jon Palmer Senior Software Engineer, Contact Networks 35 Thomson Place T3 | Boston, MA 02210 O: 617.856.1836 | M: 415.269.1862 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Brian Chavez Sent: Monday, October 06, 2008 3:18 AM To: [EMAIL PROTECTED] Subject: [nhusers] Re: Criteria querries and collections I think I tried doing this very same thing a few days ago, only with <.composite-element.> mappings. >From what I found, the answer is no, I had to promote the element to a first >class POCO in order to do some querying with Criteria API. I may be wrong, though, so wait for others to weight in. -Brian ---------------------------------------------- Brian Chavez Bit Armory, Inc. http://www.bitarmory.com From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jon Palmer Sent: Monday, October 06, 2008 2:30 AM To: [EMAIL PROTECTED] Subject: [nhusers] Criteria querries and collections Is the first item of 'Advanced Problems' on http://www.hibernate.org/117.html still true or do recent versions of NHibernate support querying collections though the Criteria API? I have a simple situation like this: Class Person { IList EmailAddresses {get; set;} } The Email addresses are mapped as simple strings like this: <class name="Person"/> <list name="EmailAddresses" table="PersonEmailAddresses" lazy=" > <key column="PersonID"/> <index column="DisplayOrder"/> <element column="EmailAddress" type="string"/> </list> </class> In HQL I can do a query on the email Addresses like this: Session.CreateQuery("from Person p join p.EmailAddresses e where e = '[EMAIL PROTECTED]'").List() Is there an equivalent using the Criteira API? I've tried a number of things but they all break in some shape or form. Thanks Jon Jon Palmer Senior Software Engineer, Contact Networks 35 Thomson Place T3 | Boston, MA 02210 O: 617.856.1836 | M: 415.269.1862 Contact Networks, a Thomson Reuters company, is the global leader of B2B social networking for professionals. -- Tuna Toksöz Typos included to enhance the readers attention!
<<image001.gif>>
