Unit を County で拡張しようとすると、特にアプリケーションを再起動して ORM を初期化するときに、エラーが発生します。[注: 単一テーブルの継承を試みています]
ORM は私の DB スキーマを管理しています:this.ormsettings.dbcreate=dropcreate
モデル ディレクトリから County.cfc を削除すると、ORM が初期化され、アプリケーションが正常に起動します。County.cfc をモデル ディレクトリに戻すと、エラーが再び発生します。
ColdFusion バージョン 10,282462 MSSQL IIS
単位:
<cfcomponent persistent="true" entityname="Unit" table="Units" discriminatorColumn="type">
<cfproperty name="id" fieldtype="id" column="unit_id" generator="identity">
<cfproperty name="name" default="" type="string" length="50">
<cfproperty name="description" type="string" sqltype="varchar(max)" default="">
<cfproperty name="active" type="boolean" default="true">
</cfcomponent>
郡:
<cfcomponent persistent="true" entityname="County" table="Units" extends="Unit" discriminatorValue="county">
<cfproperty name="officeAddress" type="string">
</cfcomponent>
スタックトレース:
java.lang.NullPointerException at
org.hibernate.mapping.PersistentClass.createPrimaryKey(PersistentClass.java:322) at
org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:405) at
org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:321) at
org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:172) at
org.hibernate.cfg.Configuration.add(Configuration.java:771) at
org.hibernate.cfg.Configuration.addDocument(Configuration.java:586) at
coldfusion.orm.hibernate.HibernateConfiguration.buildConfiguration(HibernateConfiguration.java:611) at
coldfusion.orm.hibernate.HibernateConfiguration.initHibernateConfiguration(HibernateConfiguration.java:208) at
coldfusion.orm.hibernate.HibernateConfiguration.<init>(HibernateConfiguration.java:181) at
coldfusion.orm.hibernate.ConfigurationManager.initConfiguration(ConfigurationManager.java:67) at
coldfusion.orm.hibernate.HibernateProvider.InitializeORMForApplication(HibernateProvider.java:185) at
coldfusion.orm.hibernate.HibernateProvider.onPageRequestStart(HibernateProvider.java:151) at
coldfusion.filter.ApplicationFilter.firePageRequestStart(ApplicationFilter.java:599) at
coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:407) at
coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48) at
coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40) at
coldfusion.filter.PathFilter.invoke(PathFilter.java:112) at
coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:94) at
coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:79) at
coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28) at
coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38) at
coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46) at
coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38) at
coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22) at
coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62) at
coldfusion.CfmServlet.service(CfmServlet.java:204) at
coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89) at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at
coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42) at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46) at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224) at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168) at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98) at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:928) at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:414) at
org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:203) at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539) at
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:298) at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at
java.lang.Thread.run(Thread.java:662)
奇妙なことに、私はすでに別のエンティティで同様のことを行っています (DiscussionPost は Post を拡張しています):
役職:
<cfcomponent persistent="true" entityname="Post" table="Posts" discriminatorColumn="type">
<cfproperty name="id" fieldtype="id" column="post_id" generator="identity">
<cfproperty name="promotions" fieldtype="one-to-many" cfc="PostPromotion" fkcolumn="post_id" singularname="promotion">
<cfproperty name="comments" fieldtype="one-to-many" cfc="PostComment" fkcolumn="post_id" singularname="comment">
<cfproperty name="user" fieldtype="many-to-one" cfc="User" fkcolumn="user_id">
<cfproperty name="text" type="string" sqltype="varchar(1000)">
<cfproperty name="timestamp" type="date" ormtype="timestamp">
</cfcomponent>
ディスカッション投稿:
<cfcomponent persistent="true" entityname="DiscussionPost" table="Posts" extends="Post" discriminatorValue="discussionpost">
<cfproperty name="discussion" fieldtype="many-to-one" cfc="Discussion" fkcolumn="discussion_id">
<cfproperty name="title" type="string" sqltype="varchar(200)">
</cfcomponent>
私は何が欠けていますか?