English 中文(简体)
你们如何利用冷酷的“未来”规划一个基级?
原标题:How do you map a base class using ColdFusion ORM?

我有两个组成部分:<代码>意向>。

<cfcomponent persistent="true">
    <cfproperty name="Id" fieldtype="id" generator="native">
</cfcomponent>

添加以下内容的<条码>:

<cfcomponent persistent="true" extends="Entity">
    <cfproperty name="FirstName">
    <cfproperty name="LastName">
</cfcomponent>

然而,当我试图创立一个<代码>Client的事例时,我发现了一个错误,说它们重新绘制为两个不同的表格。 我知道Hibernate是否有能力忽视一个基类,但我怎么会把它与冷战后端混为一谈,或者我是否必须重新绘制这一特征的建立信任措施地图?

增编: 将<代码>persistent=“true”从 Entity上删除。 <代码>Client的固定工作,如无,即行不通。 Id Property if I do so.

最佳回答

在你的基地“Entity”类中,试图消除持久性=“true”,并添加图形的SuperClass=“true”。

<cfcomponent mappedSuperClass="true">
    <cfproperty name="Id" fieldtype="id" generator="native">
</cfcomponent>

你们需要把9.0.1更新应用于“冷漠”。

问题回答

暂无回答




相关问题
nHibernate one-to-many inserts but doesnt update

Instead of getting into code, I have a simple question. Default behavior for a simple one-to-many is that it inserts the child record then updates the foreign key column with the parent key. Has ...

How Do I copy an existing nhibernate object as a new object?

I a persisted NHibernate object that I would like to repersist as a new entity. How do I get NHibernate to save this object as if it was a new? I am thinking I might create a session interceptor to ...

join across databases with nhibernate

I am trying to join two tables that reside in two different databases. Every time, I try to join I get the following error: An association from the table xxx refers to an unmapped class. If the ...

WPF - MVVM - NHibernate Validation

Im facing a bit of an issue when trying to validate a decimal property on domain object which is bound to a textbox on the view through the viewmodel. I am using NHibernate to decorate my property on ...

NHibernate Search in a List using ICriteria

I have my class X : public class ClassX { public virtual IList<ClassY> ListY { get; set; } ... } My ClassX mapping (using Fluent) ... HasMany<ClassX>(x => x.ListY ) ....

热门标签