开发者

Composite ID unmapped class problem

开发者 https://www.devze.com 2023-03-11 16:35 出处:网络
I want to specify the class map for 1 of the elements in composite id: CompositeId() 开发者_如何学Python.KeyReference(x => x.User, \"user_id\")

I want to specify the class map for 1 of the elements in composite id:

CompositeId()
           开发者_如何学Python     .KeyReference(x => x.User, "user_id")
                .KeyProperty(x => x.Key, "user_key");

Like this one:

References(x => x.User, "user_id").Class<User>()

But I get error for unmapped class because I use interfaces. I also tried the code bellow but no luck yet:

CompositeId()
                .KeyReference(x => x.User, e =>
e.Name(""user_id").EntityName("User"))


                .KeyProperty(x => x.Key, "user_key");
References(x => x.User, "user_id").Class<User>()


this is the answer:

https://groups.google.com/forum/#!topic/fluent-nhibernate/AnJosrxqIo8

0

精彩评论

暂无评论...
验证码 换一张
取 消