[Seasar-user:5938] Primary KeyのみのテーブルをSQL文の自動生成で更新することはできません

oiron [E-MAIL ADDRESS DELETED]
2007年 1月 29日 (月) 13:17:12 JST


谷口です。長くなってしまいました。すいません。
exampleを参考にDBをPOstgresqlにしようとしています。j2ee.di.conを変更し
て、examples.dao.DepartmentDaoClient を実行すると、
s2daoで、「Primary KeyのみのテーブルをSQL文の自動生成で更新することはできません」
と言われる時は、どこを疑っていけばよろしいでしょうか。

Exception in thread "main"
org.seasar.dao.MethodSetupFailureRuntimeException:
[EDAO0019]examples.dao.DepartmentDaoのupdateメソッドの初期化時に例外が発生しました。理由はorg.seasar.framework.exception.SRuntimeException:
[EDAO0020]Primary KeyのみのテーブルをSQL文の自動生成で更新することはできません
       at org.seasar.dao.impl.DaoMetaDataImpl.setupMethod(DaoMetaDataImpl.java:187)
       at org.seasar.dao.impl.DaoMetaDataImpl.setupMethod(DaoMetaDataImpl.java:164)
       at org.seasar.dao.impl.DaoMetaDataImpl.setupSqlCommand(DaoMetaDataImpl.java:158)
       at org.seasar.dao.impl.DaoMetaDataImpl.initialize(DaoMetaDataImpl.java:144)
       at org.seasar.dao.impl.DaoMetaDataFactoryImpl.createDaoMetaData(DaoMetaDataFactoryImpl.java:120)
       at org.seasar.dao.impl.DaoMetaDataFactoryImpl.getDaoMetaData(DaoMetaDataFactoryImpl.java:102)
       at org.seasar.dao.interceptors.S2DaoInterceptor.invoke(S2DaoInterceptor.java:51)
       at org.seasar.dao.pager.PagerS2DaoInterceptorWrapper.invoke(PagerS2DaoInterceptorWrapper.java:64)
       at examples.dao.DepartmentDao$$EnhancedByS2AOP$$482923$$MethodInvocation$$insert1.proceed(MethodInvocationClassGenerator.java)
       at examples.dao.DepartmentDao$$EnhancedByS2AOP$$482923.insert(DepartmentDao$$EnhancedByS2AOP$$482923.java)
       at examples.dao.DepartmentDaoClient.main(DepartmentDaoClient.java:34)
Caused by: org.seasar.framework.exception.SRuntimeException:
[EDAO0020]Primary KeyのみのテーブルをSQL文の自動生成で更新することはできません
       at org.seasar.dao.impl.AbstractAutoStaticCommand.setupUpdatePropertyTypes(AbstractAutoStaticCommand.java:97)
       at org.seasar.dao.impl.UpdateAutoStaticCommand.setupPropertyTypes(UpdateAutoStaticCommand.java:46)
       at org.seasar.dao.impl.AbstractAutoStaticCommand.<init>(AbstractAutoStaticCommand.java:44)
       at org.seasar.dao.impl.UpdateAutoStaticCommand.<init>(UpdateAutoStaticCommand.java:33)
       at org.seasar.dao.impl.DaoMetaDataImpl.setupUpdateMethodByAuto(DaoMetaDataImpl.java:464)
       at org.seasar.dao.impl.DaoMetaDataImpl.setupMethodByAuto(DaoMetaDataImpl.java:290)
       at org.seasar.dao.impl.DaoMetaDataImpl.setupMethod(DaoMetaDataImpl.java:184)
       ... 10 more

と出力されます。

読み込んでいるdiconは、以下になります。
どうぞよろしくお願い致します。


DepartmentDao.dicon-----------------------------------------

<?xml version="1.0" encoding="Shift_JIS"?>
<!DOCTYPE components PUBLIC "-//SEASAR//DTD S2Container//EN"
"http://www.seasar.org/dtd/components.dtd">
<components>
       <include path="dao.dicon"/>
       <component class="examples.dao.DepartmentDao">
               <aspect>dao.interceptor</aspect>
       </component>
</components>

DepartmentDao.dicon-----------------------------------------
dao.dicon---------------------------------------------------

<?xml version="1.0" encoding="Shift_JIS"?>
<!DOCTYPE components PUBLIC "-//SEASAR2.1//DTD S2Container//EN"
       "http://www.seasar.org/dtd/components21.dtd">
<components namespace="dao">
       <include path="j2ee.dicon"/>
       <component class="org.seasar.dao.impl.AnnotationReaderFactoryImpl"/>
       <component class="org.seasar.dao.impl.DaoMetaDataFactoryImpl"/>
       <component
               name="interceptor"
               class="org.seasar.dao.pager.PagerS2DaoInterceptorWrapper">
               <arg>
                       <component
class="org.seasar.dao.interceptors.S2DaoInterceptor"/>
               </arg>
       </component>
       <component class="org.seasar.dao.impl.ValueTypeFactoryImpl"/>
       <component
               name="stringClobType"
               class="org.seasar.extension.jdbc.types.StringClobType"
       />
       <component class="org.seasar.dao.impl.BeanMetaDataFactoryImpl"/>
       <component class="org.seasar.dao.impl.DaoNamingConventionImpl"/>
       <component class="org.seasar.dao.impl.BeanEnhancerImpl"/>
</components>


dao.dicon---------------------------------------------------
j2ee.dicon--------------------------------------------------

<?xml version="1.0" encoding="Shift_JIS"?>
<!DOCTYPE components PUBLIC "-//SEASAR2.1//DTD S2Container//EN"
       "http://www.seasar.org/dtd/components21.dtd">
<components namespace="j2ee">
       <component name="transactionManager"
               class="org.seasar.extension.jta.TransactionManagerImpl"/>
       <component name="requiredTx"
               class="org.seasar.extension.tx.RequiredInterceptor"/>
       <component name="requiresNewTx"
               class="org.seasar.extension.tx.RequiresNewInterceptor"/>
       <component name="mandatoryTx"
               class="org.seasar.extension.tx.MandatoryInterceptor"/>
       <component name="notSupportedTx"
               class="org.seasar.extension.tx.NotSupportedInterceptor"/>

       <component
               name="resultSetFactory"
               class="org.seasar.dao.pager.PagerResultSetFactoryWrapper">
               <arg>
                       <component
class="org.seasar.extension.jdbc.impl.BasicResultSetFactory"/>
               </arg>
               <property name="useScrollCursor">true</property>
       </component>
       <!--
       <component
               name="resultSetFactory"
               class="org.seasar.dao.pager.PagerResultSetFactoryLimitOffsetWrapper">
               <arg>
                       <component
class="org.seasar.extension.jdbc.impl.BasicResultSetFactory"/>
               </arg>
               <arg>dataSource</arg>
       </component>
       -->

       <component
class="org.seasar.extension.jdbc.impl.ConfigurableStatementFactory">
               <arg>
                       <component
class="org.seasar.dao.pager.PagerStatementFactory"/>
               </arg>
               <property name="fetchSize">100</property>
               <!--
               <property name="maxRows">100</property>
               -->
       </component>

       <!--
       <component class="org.seasar.extension.jdbc.impl.BasicResultSetFactory"/>
       <component
class="org.seasar.extension.jdbc.impl.ConfigurableStatementFactory">
               <arg>
                       <component
class="org.seasar.extension.jdbc.impl.BasicStatementFactory"/>
               </arg>
               <property name="fetchSize">100</property>
               <! - -
               <property name="maxRows">100</property>
               - - >
       </component>
       <component
class="org.seasar.extension.jdbc.impl.OracleResultSetFactory"/>
       <component
class="org.seasar.extension.jdbc.impl.BooleanToIntStatementFactory"/>
       -->

       <component name="xaDataSource"
               class="org.seasar.extension.dbcp.impl.XADataSourceImpl">
               <property name="driverClassName">
                       "org.postgresql.Driver"
               </property>
               <property name="URL">

                       "jdbc:postgresql:test_s2dao1"
                       <!--
                       "jdbc:hsqldb:file:"
                               +
@[E-MAIL ADDRESS DELETED](@[E-MAIL ADDRESS DELETED]).getCanonicalPath()
                               + "/data-hsqldb/demo"-->
               </property>
               <property name="user">"norio"</property>
               <property name="password">""</property>
       </component>

       <component name="connectionPool"
               class="org.seasar.extension.dbcp.impl.ConnectionPoolImpl">
               <property name="timeout">600</property>
               <property name="maxPoolSize">10</property>
               <property name="allowLocalTx">true</property>
               <destroyMethod name="close"/>
       </component>
       <component name="dataSource"
               class="org.seasar.extension.dbcp.impl.DataSourceImpl"/>

</components>

j2ee.dicon--------------------------------------------------
dao.dicon---------------------------------------------------

<?xml version="1.0" encoding="Shift_JIS"?>
<!DOCTYPE components PUBLIC "-//SEASAR2.1//DTD S2Container//EN"
       "http://www.seasar.org/dtd/components21.dtd">
<components namespace="dao">
       <include path="j2ee.dicon"/>
       <component class="org.seasar.dao.impl.AnnotationReaderFactoryImpl"/>
       <component class="org.seasar.dao.impl.DaoMetaDataFactoryImpl"/>
       <component
               name="interceptor"
               class="org.seasar.dao.pager.PagerS2DaoInterceptorWrapper">
               <arg>
                       <component
class="org.seasar.dao.interceptors.S2DaoInterceptor"/>
               </arg>
       </component>
       <component class="org.seasar.dao.impl.ValueTypeFactoryImpl"/>
       <component
               name="stringClobType"
               class="org.seasar.extension.jdbc.types.StringClobType"
       />
       <component class="org.seasar.dao.impl.BeanMetaDataFactoryImpl"/>
       <component class="org.seasar.dao.impl.DaoNamingConventionImpl"/>
       <component class="org.seasar.dao.impl.BeanEnhancerImpl"/>
</components>


dao.dicon---------------------------------------------------


-----
 Taniguchi <[E-MAIL ADDRESS DELETED]>



Seasar-user メーリングリストの案内