cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Johannes <>
Subject Re: double primary key exception
Date Mon, 22 Dec 2014 22:54:18 GMT
Hello Andrew.

I did not understand your question completely. But here are DbEntity and
ObjEntity from my file.

 <obj-entity name="Category" className=""
                <obj-attribute name="id" type="int" db-attribute-path="id"/>
                <obj-attribute name="name" type="java.lang.String"
 <db-entity name="category" schema="public">
                <db-attribute name="id" type="INTEGER"
isPrimaryKey="true" isMandatory="true"/>
                <db-attribute name="name" type="VARCHAR" length="500"/>


Hm, when I look at my table definition, I forgot the foreign key
constraint. But this should be the root cause.

test=> \d category
          Tabelle ┬╗public.category┬ź
 Spalte |          Typ           | Attribute
 id     | integer                | not null
 name   | character varying(500) |
    "category_pkey" PRIMARY KEY, btree (id)
    "category_name_key" UNIQUE CONSTRAINT, btree (name)

Regards Johannes

Am 22.12.2014 um 22:44 schrieb Andrew Lindesay:
> Hello Johannes;
> What is the value of settings under the "Primary Key" section in the
> modeller for the "category"?
> Regards;
>> In some circumstances, which I don't know exactly, I have problems with
>> my sequences. It believe the postgres nextval is not called and with
>> some magic the next pk is incremented by something else.

View raw message