cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joose Vettenranta <jo...@iki.fi>
Subject ojb/jdo and 1:n collection
Date Wed, 21 Jul 2004 15:09:24 GMT
I have in package.jdo (and enhanced that with binaries):
<class name="CategoryName" identity-type="datastore">
    <extension vendor-name="ojb" key="table" value="category_names"/>
    <field name="id" persistence-modifier="persistent">
      <extension vendor-name="ojb" key="column" value="id"/>
     </field>
     <field name="lang" persistence-modifier="persistent">
        <extension vendor-name="ojb" key="column" value="lang_id"/>
     </field>
     <field name="category" persistence-modifier="persistent">
     <collection element-type="Category">
      <extension vendor-name="jdo" key="inverse" value="id" />
      </collection>
       <extension vendor-name="ojb" key="column" value="category_id"/>
       </field>
     </class>

I have in repository.xml:

   <class-descriptor class="net.vettenranta.category.bean.CategoryName" 
table="category_names">
     <field-descriptor name="id" jdbc-type="INTEGER" primarykey="true" 
default-fetch="true" access="readonly" indexed="true" 
autoincrement="true" sequence-name="category_names_id_seq" 
column="id"/>
     <field-descriptor name="lang" column="lang_id" jdbc-type="INTEGER"/>
     <field-descriptor name="name" column="name" jdbc-type="VARCHAR"/>
     <collection-descriptor name="category_id" 
element-class-ref="net.vettenranta.category.bean.Category"
auto-retrieve="true"
auto-update="false"
auto-delete="true">
       <inverse-foreignkey field-ref="id"/>
     </collection-descriptor>

And now this happens when I'm trying to do saving:

[18] LOG:  query: begin;
[19] LOG:  query: select nextval('product_categories_id_seq')
[20] LOG:  query: select nextval('category_names_id_seq')
[21] LOG:  query: INSERT INTO category_names (lang_id,name) VALUES 
(2,'Testing')
[22] ERROR:  ExecInsert: Fail to add null value in not null attribute 
category_id
[23] LOG:  query: SELECT 1
[24] ERROR:  current transaction is aborted, queries ignored until end 
of transaction block

it should do INSERT INTO category_names (lang_id,category_id,name) 
VALUES (2, {thing which came from [19]}, 'Testing')

What I'm doing wrong this time?=)

Thanks,

Joose

--
"Always remember that you are unique, just like everyone else!"
* http://iki.fi/joose/ * joose@iki.fi * +358 44 561 0270 *


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message