Hello Hassan,
Does your torque.properties file contain:
torque.database.default=m3c
torque.database.m3c.adapter=postgresql
??
Hope it helps,
Andras.
Hassan Abolhassani wrote:
>I tried to follow your advises but still have the same problem.
>
>Here is the situation right now:
>
>1- In xml schema:
><database name="m3c" defaultIdMethod="native">
><table name="HOSPITAL" idMethod="native">
><column name="ID" required="true" autoIncrement="true" primaryKey="true"
>type="INTEGER" />
><column name="NAME" required="true" size="30" type="VARCHAR" />
>...
><id-method-parameter name="seqName" value="hospital_id_seq"/>
></table>
>
>2- In Postgres i see that a sequence with the name "hospital_id_seq" is
>created.
>
>3- In postgres the hospital table has following schema:
>-- Table: public.hospital
>CREATE TABLE public.hospital (
> id int4 DEFAULT nextval('public.hospital_id_seq'::text) NOT NULL,
> name varchar(30) NOT NULL,
> ...
> CONSTRAINT hospital_pkey PRIMARY KEY (id)
>) WITH OIDS;
>
>4- In HospitalMapBuilder.java there are following lines:
> dbMap.addTable("HOSPITAL");
> TableMap tMap = dbMap.getTable("HOSPITAL");
>
> tMap.setPrimaryKeyMethod(TableMap.NATIVE);
>
> // this might need upgrading based on what all the databases
> // need, but for now assume one parameter.
> tMap.setPrimaryKeyMethodInfo("hospital_id_seq");
>
>
>The problem is when inserting, following exception happens:
>.[Ljava.lang.StackTraceElement;@763f5d
>org.apache.torque.TorqueException: IdGenerator for table 'HOSPITAL' is null
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]