You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-user@db.apache.org by Ferruh Zamangoer <fe...@gistec-online.de> on 2004/08/18 17:31:39 UTC

ERROR: Database insert attempted without anything specified to insert

Hi,

i just try to insert a value into table where I have only one Field, which
is also the primary key field. In the tutorial I have seen the following
code for inserting:

Publisher addison = new Publisher();
addison.setName("Addison Wesley Professional");
addison.save();

What I want to make is like this:

Publisher addison = new Publisher();
addison.save();

But it doesn't work.

I've defined the table in the project-schema.xml like this for example:

<table name="publisher" description="Publisher Table">
    <column
      name="publisher_id"
      required="true"
      primaryKey="true"
      type="INTEGER"
      description="Publisher Id"/>

Thanks for any help.

regards
Ferruh



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


AW: ERROR: Database insert attempted without anything specified to insert

Posted by Ferruh Zamangoer <fe...@gistec-online.de>.
I have defined the defaultIdMethod="native" but it doesn't work. I have
forgot to say I'am using a ORACLE 9i database.



-----Ursprungliche Nachricht-----
Von: Robert Bowen [mailto:syg6@yahoo.com]
Gesendet: Mittwoch, 18. August 2004 18:05
An: Apache Torque Users List
Betreff: Re: ERROR: Database insert attempted without anything specified
to insert


How do you have the "defaultIdMethod" defined?

If it's "native" then your database should take care
of automatically putting the value in the
"publisher_id" field. If it is defined as "idbroker"
then make sure the id_broker table exists and has data
for the publisher table.

Regards,
syg
--- Ferruh Zamangoer
<fe...@gistec-online.de> wrote:

> Hi,
>
> i just try to insert a value into table where I have
> only one Field, which
> is also the primary key field. In the tutorial I
> have seen the following
> code for inserting:
>
> Publisher addison = new Publisher();
> addison.setName("Addison Wesley Professional");
> addison.save();
>
> What I want to make is like this:
>
> Publisher addison = new Publisher();
> addison.save();
>
> But it doesn't work.
>
> I've defined the table in the project-schema.xml
> like this for example:
>
> <table name="publisher" description="Publisher
> Table">
>     <column
>       name="publisher_id"
>       required="true"
>       primaryKey="true"
>       type="INTEGER"
>       description="Publisher Id"/>
>
> Thanks for any help.
>
> regards
> Ferruh
>
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail:
> torque-user-help@db.apache.org
>
>




__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Re: ERROR: Database insert attempted without anything specified to insert

Posted by Robert Bowen <sy...@yahoo.com>.
How do you have the "defaultIdMethod" defined?

If it's "native" then your database should take care
of automatically putting the value in the
"publisher_id" field. If it is defined as "idbroker"
then make sure the id_broker table exists and has data
for the publisher table.

Regards,
syg
--- Ferruh Zamangoer
<fe...@gistec-online.de> wrote:

> Hi,
> 
> i just try to insert a value into table where I have
> only one Field, which
> is also the primary key field. In the tutorial I
> have seen the following
> code for inserting:
> 
> Publisher addison = new Publisher();
> addison.setName("Addison Wesley Professional");
> addison.save();
> 
> What I want to make is like this:
> 
> Publisher addison = new Publisher();
> addison.save();
> 
> But it doesn't work.
> 
> I've defined the table in the project-schema.xml
> like this for example:
> 
> <table name="publisher" description="Publisher
> Table">
>     <column
>       name="publisher_id"
>       required="true"
>       primaryKey="true"
>       type="INTEGER"
>       description="Publisher Id"/>
> 
> Thanks for any help.
> 
> regards
> Ferruh
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail:
> torque-user-help@db.apache.org
> 
> 



		
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org