0
나의 현재 프로젝트에서, 워크 플로우에는 주석이있다. 다음 코드를 살펴보십시오.NHibernate Mapping (Attributes) : KeyProperty가 지속되지 않는다.
[CompositeId]
[KeyProperty(1, Column = "datum", Name = "Date", TypeType = typeof(DateTime))]
[KeyManyToOne(1, Column = "workflow_id", Name = "Workflow", ClassType = typeof(Workflow))]
public virtual IWorkflow Workflow { get; set; }
[Property(Column = "kommentar")]
public virtual string CommentText { get; set; }
public virtual DateTime Date { get; set; }
하단 선을이 관계 workflows(1)<---->(n)comments
(날짜 당 하나)를 설명한다. 이 유형의 엔티티를 저장할 때 데이터베이스는 열 "datum"이 null이 될 수 없다는 제약 조건 위반을보고합니다. 이는 아닙니다 (객체에 값이 있음).
아무도이 매핑에서 실수를 볼 수 있나요 ... 다른 방법으로 본다?