-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: <key-many-to-one> and insert=false update=false
PostPosted: Mon Feb 21, 2005 10:16 pm 
Beginner
Beginner

Joined: Thu Feb 03, 2005 7:23 pm
Posts: 23
Hello,

I am using h3, with h3 tools. I have created a db schema, and run artifact generation successfully, however when I tried to run schema export I got the error:

org.hibernate.MappingException: Repeated column in mapping for entity: graph.base.Edgestore column: GID (should be mapped with insert="false" update="false")

the table in question has the following structure:
columns: GID,SID,SOURCE,TARGET
primary_key: GID,SID,SOURCE,TARGET
fk_1: GID,SID to graphstore table, columns GID,SID
fk_2: GID,SID,SOURCE to vertextore table, columns GID,SID,VID
fk_3: GID,SID.TARGET to vertextore table, columns GID,SID,VID

now the corresponding mapping file looks like:

<composite-id
name="id"
class="graph.base.EdgestoreId"
>

<key-many-to-one name="Graphstore" class="graph.base.Graphstore">
<column name="GID" length="22" not-null="false" />
<column name="SID" length="22" not-null="false" />
</key-many-to-one>

<key-many-to-one name="source" class="graph.base.Vertexstore">
<column name="GID" length="22" not-null="false" />
<column name="SID" length="22" not-null="false" />
<column name="SOURCE" length="22" not-null="false" />
</key-many-to-one>

<key-many-to-one name="target" class="graph.base.Vertexstore">
<column name="GID" length="22" not-null="false" />
<column name="SID" length="22" not-null="false" />
<column name="TARGET" length="22" not-null="false" />
</key-many-to-one>

</composite-id>

I understand (and it works, tested) a plain <many-to-one> with
insert="false" update="false" works. however, I get a mapping error
when I put insert="false" update="false" to a <key-many-to-one>

I get: Caused by: org.xml.sax.SAXParseException: Attribute "insert" is not declared for element "key-many-to-one".

I am trying to map a graph-theory object (vertices linked by edges) into hibernate, and I spend quite sometime doing this project. The reason I used the artifact generator was to see how close it would generate code (that I had previously written) it came quite close actually, except the update,insert error, which was a problem that I could not overcome with my handwritten code.

the underlying schema is one I can not really change, because it is accessed by another c++ program. this schema and mapping came very, very close to working, with exception of this error.

please help,

best regards,
-O.B.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.