G
Gast
Gast
Hallo
Umgebung:
HSQLDB, Hibernate 3, Spring 2
folgende Struktur:
Entities A,B
A hat ein OneToMany Realtion zu B mit Cascade All und notNull (siehe Mapping)
Problem:
Ich bekomme beim Einfuegen von A folgende Exception:
Mapping:
Ablauf des Codes:
...
Erzeuge A
Erzeuge B
Setze Relation an A
save(A)
...
ps: Diese Exception bekomme ich auch, wenn z.B. A einfuege, B erzeuge, die Relation setze und B einfuege (Exception!)
Umgebung:
HSQLDB, Hibernate 3, Spring 2
folgende Struktur:
Entities A,B
A hat ein OneToMany Realtion zu B mit Cascade All und notNull (siehe Mapping)
Problem:
Ich bekomme beim Einfuegen von A folgende Exception:
Code:
WARNUNG: SQL Error: -10, SQLState: 23000
12.12.2007 13:29:27 org.hibernate.util.JDBCExceptionReporter logExceptions
SCHWERWIEGEND: Attempt to insert null into a non-nullable column: column: BLOCKS table: LEARNMODULEBLOCK in statement [insert into LearnModuleBlock (LearnModuleBlockId, Name) values (null, ?)]
Mapping:
Code:
<list name="blocks" lazy="true" access="field" cascade="all">
<key>
<column name="Blocks" not-null="true" />
</key>
<index column="blocks_pos" />
<one-to-many class="com.scoyo.data.content.LearnModuleBlockImpl" />
</list>
Ablauf des Codes:
...
Erzeuge A
Erzeuge B
Setze Relation an A
save(A)
...
ps: Diese Exception bekomme ich auch, wenn z.B. A einfuege, B erzeuge, die Relation setze und B einfuege (Exception!)