db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Rodriguez Millan" <daniel.rodrig...@esencialsistemas.com>
Subject Error: Database insert attempted without anything specified to insert
Date Sun, 27 Apr 2003 09:46:30 GMT
Im getting the exception:
 
org.apache.torque.TorqueException:Database insert attempted without
anything specified to insert
 
with my first torque application
 
Could someone explain me why this exception may be raised?
 
My relevant data are:
 
Mysql db:
 
   
    <table name="loc" 
        javaName="Loc">
        <column 
            name="locId"       
            required="true"     
            primaryKey="true"   
            type="INTEGER"
            autoIncrement="true"
            javaName="locId"/>
        <column 
            name="locName"     
            required="true"    
             primaryKey="true"   
            type="VARCHAR"      
            size="100"
            javaName="locName"/>
    </table>
 
and my code raising the exception:
 
            try
                  {
                        Loc l=new Loc();
                        l.setlocId(0);
                        l.setlocName("loc");
                        LocPeer.doInsert(l);
                  }
                  catch (Exception e)
                  {
                  System.out.println("Error:"+e);
                  }     
 
i tried l.setlocName("loc") and then save, without the doInsert call and
not setting the autoincrement value, but the exception seems to be
thrown with all tables in my db :-(
 
 
any help?
 
 
 
Daniel rodriguez millan

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