[nhusers] Mapping 1 - [zero or 1] Relationship

2009-02-11 Thread Hendry Luk
Hi there, I'm wondering how the scenario below can be mapped through NH. It's a legacy entity structure. public class Customer { public Address HomeAddress {get;set;} public Address WorkAddress {get; set;} public Address BillingAddress {get;set;} } Unfortunately, it's also mapped

[nhusers] Re: Mapping 1 - [zero or 1] Relationship

2009-02-13 Thread Hendry Luk
discriminator column, then subclass Address for the various types. Perhaps there's a better way, but that should work. On Wed, Feb 11, 2009 at 8:36 PM, Hendry Luk hendrym...@gmail.com wrote: Hi there, I'm wondering how the scenario below can be mapped through NH. It's a legacy entity structure

[nhusers] Re: Linq Query ToLower

2009-07-27 Thread Hendry Luk
I also bumped into this problem (non-case-sensitive String.Contains() is a really common requirement), and still looking for a solution for this.. which apparently still produces the same exception in the recent release of NH-Linq. Any idea? Thanks On Tue, May 5, 2009 at 1:24 PM, Bryan Murphy

[nhusers] Re: Linq Query ToLower

2009-07-27 Thread Hendry Luk
, regarding to string.contains. Tuna Toksöz Eternal sunshine of the open source mind. http://devlicio.us/blogs/tuna_toksoz http://tunatoksoz.com http://twitter.com/tehlike On Mon, Jul 27, 2009 at 10:25 AM, Hendry Luk hendrym...@gmail.com wrote: I also bumped into this problem (non-case

[nhusers] Re: Linq Query ToLower

2009-07-27 Thread Hendry Luk
Sorry, no joy.. Still exact same exception.. Cheers On Mon, Jul 27, 2009 at 5:35 PM, Tuna Toksoz tehl...@gmail.com wrote: can you retry your query like this: string emailAddress=his.EmailAddress.ToLower(); from u in session.LinqUser() where u.EmailAddress.ToLower() == emailAddress select

[nhusers] Re: Linq Query ToLower

2009-07-27 Thread Hendry Luk
that accepts StringComparison parameter. Cheers On Mon, Jul 27, 2009 at 6:01 PM, Hendry Luk hendrym...@gmail.com wrote: Sorry, no joy.. Still exact same exception.. Cheers On Mon, Jul 27, 2009 at 5:35 PM, Tuna Toksoz tehl...@gmail.com wrote: can you retry your query like this: string

[nhusers] OOT: Hibernate User Group

2010-06-09 Thread Hendry Luk
Does anyone know any? I joined java-hibern...@googlegroups.com, but the only activities it has ever had seems to be its continous flow of job vacancy spams. There's no sign of humans life, unless they're all hibernating (pun clearly intended), and obviously there's no response to the question I

[nhusers] Delete Orphans on 1-1 or M-1

2010-10-20 Thread Hendry Luk
Just wondering if that's still not supported, and if there's a plan for NH to support that scenario. I really think it should be. Cheers Hendry -- You received this message because you are subscribed to the Google Groups nhusers group. To post to this group, send email to

[nhusers] Re: Delete Orphans on 1-1 or M-1

2010-10-20 Thread Hendry Luk
Just found a post from a couple months back that it's not supposed to be supported. Any reason why? Isn't it quite easy to implement? delete from child_table where id not in (select child_id from parent_table)? On Thu, Oct 21, 2010 at 2:57 PM, Hendry Luk hendrym...@gmail.com wrote: Just

[nhusers] Map (dictionary) in NH3

2010-11-22 Thread Hendry Luk
Hello, Has anyone tried Map (dictionary) element on NH3x? I haven't tried with NH2, but the following hbm file is rejected by NHibernate due to xsd validation (which shouldnt be. The hbm is validated successfully against the xsd within visual-studio). The hbm mapping file looks like this. class

Re: [nhusers] one-to-one and cascade=all,delete-orphan

2010-11-22 Thread Hendry Luk
I think this is asked very frequently (including by me, just a couple weeks ago), and very little reply, but it's safe to say that it's still unsuported till date, and possibly will never be. Currently the workaround I use has always been mapping to a one-to-many private list field, and have your

[nhusers] Re: Map (dictionary) in NH3

2010-11-22 Thread Hendry Luk
empty space (but it evidently wasn't). On Tue, Nov 23, 2010 at 2:53 PM, Hendry Luk hendrym...@gmail.com wrote: Hello, Has anyone tried Map (dictionary) element on NH3x? I haven't tried with NH2, but the following hbm file is rejected by NHibernate due to xsd validation (which shouldnt be. The hbm

[nhusers] One-to-many to a subclass

2010-12-02 Thread Hendry Luk
Hello, Is there any way to make one-many bag association from an entity to a subclass (with join)? Just an isolated example: class name=Person !-- blah blah -- discriminator column=PersonType / /class subclass name=Employee discriminator-value=Employee !-- blah blah -- join table=Emplooyee key

[nhusers] Re: One-to-many to a subclass

2010-12-02 Thread Hendry Luk
, 2010 at 8:45 PM, Hendry Luk hendrym...@gmail.com wrote: Hello, Is there any way to make one-many bag association from an entity to a subclass (with join)? Just an isolated example: class name=Person !-- blah blah -- discriminator column=PersonType / /class subclass name=Employee

Re: [nhusers] One-to-many to a subclass

2010-12-02 Thread Hendry Luk
, Dec 2, 2010 at 6:45 AM, Hendry Luk hendrym...@gmail.com wrote: Hello, Is there any way to make one-many bag association from an entity to a subclass (with join)? Just an isolated example: class name=Person !-- blah blah -- discriminator column=PersonType / /class subclass name=Employee

Re: [nhusers] One-to-many to a subclass

2010-12-03 Thread Hendry Luk
at 12:01 AM, Fabio Maulo fabioma...@gmail.com wrote: why not joined-subclass ? On Thu, Dec 2, 2010 at 7:20 PM, Hendry Luk hendrym...@gmail.com wrote: Yes, in this case, because Employee has association to Company, and also other properties. Is there any other way to achieve that other than

[nhusers] NH Bug: InvalidCastException within NH logging for composite-id

2011-01-06 Thread Hendry Luk
Hello, How does one go about reporting a new bug in NH jira? I encountered the following issue. ?xml version=1.0 encoding=utf-8 ? hibernate-mapping xmlns=urn:nhibernate-mapping-2.2 assembly=MyDomain namespace=MyDomain.Model

Re: [nhusers] Re: lazy = no-proxy does eager load in NH 3.0.0

2011-01-06 Thread Hendry Luk
I was under impression that you certainly don't. No-proxy means that your owner-entity's property will directly hit the DB and return your actual associated entity as soon as you access the getter, instead of returning the proxy of the associated-entity. On Thu, Jan 6, 2011 at 2:29 AM, Aaron

Re: [nhusers] NH Bug: InvalidCastException within NH logging for composite-id

2011-01-07 Thread Hendry Luk
/en/index.html#mapping-declaration-onetoone you need to use generator class=foreign on UserProfile id as described there. 2011/1/7 Hendry Luk hendrym...@gmail.com Hello, How does one go about reporting a new bug in NH jira? I encountered the following issue. ?xml version=1.0 encoding=utf-8

Re: [nhusers] NH Bug: InvalidCastException within NH logging for composite-id

2011-01-09 Thread Hendry Luk
the composite id and you are wrong about using a many to one. You DONT have many profiles for a user, you have only one, thus it is a one-to-one association (by pk) perfectly supported by nhibernate. Composite ids are composite, it is not right having one column. 2011/1/8, Hendry Luk hendrym

Re: [nhusers] NH Bug: InvalidCastException within NH logging for composite-id

2011-01-09 Thread Hendry Luk
. 2011/1/8, Hendry Luk hendrym...@gmail.com: That's because composite-id is the only way to make many-to-one association on your ID. There's no other way. You are allowed to have one or more properties as your composite-id. So one property is completely a valid mapping. What's invalid here

Re: [nhusers] NH Bug: InvalidCastException within NH logging for composite-id

2011-01-09 Thread Hendry Luk
Which brings me to this question: Is there any way to have association as your primary key? E.g. something that allows you to say session.Add(new UserProfile(user)), and session.GetUserProfile(user)? Cheers On Mon, Jan 10, 2011 at 11:02 AM, Hendry Luk hendrym...@gmail.com wrote: ## Errata

Re: [nhusers] NH Bug: InvalidCastException within NH logging for composite-id

2011-01-09 Thread Hendry Luk
it. 2011/1/9 Hendry Luk hendrym...@gmail.com Which brings me to this question: Is there any way to have association as your primary key? E.g. something that allows you to say session.Add(new UserProfile(user)), and session.GetUserProfile(user)? Cheers On Mon, Jan 10, 2011 at 11:02 AM

Re: [nhusers] NH Bug: InvalidCastException within NH logging for composite-id

2011-01-09 Thread Hendry Luk
in place, and we were assuming that it would be quite straightforward for NH to map this id as an association. On Mon, Jan 10, 2011 at 3:07 PM, Hendry Luk hendrym...@gmail.com wrote: I forgot to mention that I dont have any association between user and user.Profile. And by the way, UserProfile

[nhusers] LockMode.FORCE with generated Version

2011-08-17 Thread Hendry Luk
Is there any plan for it to be supported? Currently it throws LockMode.Force is currently not supported for generated version properties. I can't see any technical reason why NH can't do it. One way I can think NH can do it is to issue the following sql: update entity set id = id where