gpt4 book ai didi

c# - 实现休眠。类+抽象基类

转载 作者:太空宇宙 更新时间:2023-11-03 17:04:18 25 4
gpt4 key购买 nike

我有以下数据库设置:

enter image description here

我需要一个将其映射到的 nhibernate 文件:

  • PowerPrognosisUsageSubmission
  • PowerPrognosisWindSubmission
  • PowerPrognosisSubmissionBase 抽象基类

虽然,我无处可去。这是我的尝试:

我尝试实现 PowerPrognosisUsageSubmission

<?xml version="1.0" encoding="utf-8"?>
<hibernate-mapping namespace="DC.Client.Models.Model" assembly="DC.Client.Models" xmlns="urn:nhibernate-mapping-2.2">
<class name="PowerPrognosisUsageSubmission" table="PowerPrognosisSubmissionBase" schema="`dbo`" mutable="true" lazy="false">
<id name="PowerPrognosisSubmissionId" access="property" column="`PowerPrognosisSubmissionBaseID`">
<generator class="native" />
</id>
<property name="Date" column="`Date`" />
<property name="Hour" column="`Hour`" />
<property name="Direction" column="`Direction`" />
<property name="Submission" column="`Submission`" />
<property name="Basis" column="`Basis`" />
<many-to-one name="PowerPrognosisUsageArea" class="PowerPrognosisUsageArea" column="`PowerPrognosisAreaBaseID`" not-null="false" lazy="false" />
<joined-subclass name="PowerPrognosisUsageSubmission" table="PowerPrognosisUsageSubmission">
<key column="`Usage`" />
</joined-subclass>
</class>
</hibernate-mapping>

有什么帮助吗?

最佳答案

我自己解决的

<?xml version="1.0" encoding="utf-8"?>
<hibernate-mapping namespace="DC.Client.Models.Model" assembly="DC.Client.Models" xmlns="urn:nhibernate-mapping-2.2">
<class name="PowerPrognosisSubmissionBase" table="PowerPrognosisSubmissionBase" schema="`dbo`" mutable="true" lazy="false">
<id name="PowerPrognosisSubmissionId" access="property" column="`PowerPrognosisSubmissionBaseID`">
<generator class="native" />
</id>
<property name="Date" column="`Date`" />
<property name="Hour" column="`Hour`" />
<property name="Direction" column="`Direction`" />
<property name="Submission" column="`Submission`" />
<property name="Basis" column="`Basis`" />
<many-to-one name="PowerPrognosisAreaUsage" class="PowerPrognosisAreaUsage" column="`PowerPrognosisAreaBaseID`" not-null="false" lazy="false" />
<joined-subclass name="PowerPrognosisSubmissionUsage" table="PowerPrognosisSubmissionUsage">
<key column="`PowerPrognosisSubmissionBaseID`" />
<property name="Usage" column="`Usage`" />
</joined-subclass>
<joined-subclass name="PowerPrognosisSubmissionWind" table="PowerPrognosisSubmissionWind">
<key column="`PowerPrognosisSubmissionBaseID`" />
<property name="PriceAreaEffect" column="`PriceAreaEffect`" />
<property name="ResponsibleEffect" column="`ResponsibleEffect`" />
<property name="W2UShare" column="`W2UShare`" />
<property name="PointCarbonShare" column="`PointCarbonShare`" />
</joined-subclass>
</class>
</hibernate-mapping>

关于c# - 实现休眠。类+抽象基类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7711824/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com