db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dongsheng Song" <egcs1...@msn.com>
Subject Help: Database insert attempted without anything specified to insert
Date Tue, 21 Jan 2003 03:55:53 GMT
Hi, When I use torque insert to a 2 columns table, using following code,

WebUserGroup ug = new WebUserGroup();
ug.setGroupID(3);
ug.setUserID(5);
WebUserGroupPeer.doInsert(ug);

When running, Torque report the following errors,

org.apache.torque.TorqueException: Database insert attempted without anything specified to
insert
        at org.apache.torque.util.BasePeer.doInsert(BasePeer.java:666)
        at com.foresee.security.om.BaseWebUserGroupPeer.doInsert(BaseWebUserGroupPeer.java:215)
        at com.foresee.security.om.BaseWebUserGroupPeer.doInsert(BaseWebUserGroupPeer.java:563)
        at com.foresee.security.om.BaseWebUserGroup.save(BaseWebUserGroup.java:400)
        at com.foresee.security.om.BaseWebUserGroup.save(BaseWebUserGroup.java:362)
        at Test.main(Test.java:40)

The relative XML schema is,

  <table name="web_user_group" description="User and Group Relation Table">
    <column
      name="user_id"
      required="true"
      primaryKey="true"
      type="INTEGER"
      javaName="UserID"
      description="User Id"/>
    <column
      name="group_id"
      required="true"
      primaryKey="true"
      type="INTEGER"
      javaName="GroupID"
      description="Group Id"/>
    <foreign-key foreignTable="web_user">
      <reference
        local="user_id"
        foreign="user_id"/>
    </foreign-key>
    <foreign-key foreignTable="web_group">
      <reference
        local="group_id"
        foreign="group_id"/>
    </foreign-key>
  </table>

Thanks for somehelp.

Dongsheng Song
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message