db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Fischer <fisc...@seitenbau.net>
Subject RE: Setting pk manually
Date Tue, 14 Jun 2005 09:26:34 GMT




Hi,

Try the following:

Pseudonmys pseudonyms = new Pseudonyms();
pseudonyms.setNickname("myNickname");
...
pseudonyms.save();

    Thomas

"Ferruh Zamangoer" <ferruh.zamangoer@gmx.de> schrieb am 14.06.2005
11:00:39:

> Hi,
>
>
>
> another problem is that I have a table where the primary key is a
varchar. I
> use in my schema the defaultIdMethod = native. How can I set the pk
manually
> in this table. In the pseudonyms table I had set the idMethod="none".
>
>
>
>
>
> <database name="confuoco"
>
>             defaultJavaType="object"
>
>             defaultIdMethod="native"
>
>             skipSql="false">
>
>
>
> <!-- #### TABLE PSEUDONYMS ####-->
>
>
>
> <table name="PSEUDONYMS" description="PSEUDONYMS TABLE" idMethod="none"
>
>   javaNamingMethod="underscore">
>
> <column
>
>   name="NICKNAME"
>
>   required="true"
>
>   primaryKey="true"
>
>   type="VARCHAR"
>
>   size="256"
>
>   description="NICKNAME"/>
>
> <column
>
>   name="USER_ID"
>
>   required="true"
>
>   type="INTEGER"
>
>   description="USER_ID"/>
>
> <column
>
>   name="STATUS"
>
>   required="true"
>
>   type="INTEGER"
>
>   size="1"
>
>   description="STATUS"/>
>
> <foreign-key foreignTable="CONFUOCO_USER">
>
>             <reference
>
>         local="USER_ID"
>
>         foreign="ID"/>
>
> </foreign-key>
>
> </table>
>
> .......
>
>
>
>
>
> Can I set an entry like:
>
>
>
> Pseudonyms pseudonyms = new Pseudonyms();
>
>             pseudonyms.setNickname(pseudonym);
>
>             pseudonyms.setUserId(primaryKeyUser);
>
>             pseudonyms.setStatus(new Integer(1));
>
>             pseudonyms.save();
>
>
>
> Thanks for any help.
>
> Ferruh
>
>
>
>
>
>
>
>
>
>
>


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


Mime
View raw message