NHibernate - Mapping a String Foreign Key

后端 未结 4 446
天涯浪人
天涯浪人 2021-01-19 12:48

The legacy database I\'ve inherited contains the following tables:

Teams ( 
 TeamId INT PRIMARY KEY,
 Name VARCHAR(30)
)

Players (
 PlayerId INT PRIMARY KEY         


        
4条回答
  •  旧巷少年郎
    2021-01-19 13:32

    I believe that you would need to use the property-ref attribute to define the field that you will be associating to. The foreign-key attribute is used to generate DDL to create the relationships (if you use that feature).

提交回复
热议问题