Hi.
This is a part mapping file:
<class name="artesanos.modelo.Region"
identity="idRegion" key-generator="MAX">
<map-to
table="regionGeografica"/>
<field
name="idRegion"
type="integer" direct="true" get-method="getIdRegion" set-method="setIdRegion" required="true"> <sql name="idRegion" type="integer"/> </field> <field
name="nombre"
type="java.lang.String" direct="true" get-method="getNombre" set-method="setNombre" required="true"> <sql name="nombre" type="varchar"/> </field> <field
name="descripcion"
type="java.lang.String" direct="true" get-method="getDescripcion" set-method="setDescripcion" required="false"> <sql name="descripcion" type="varchar"/> </field> <field
name="provincias"
type="artesanos.modelo.Provincia" required="false" collection="vector"> <sql name="idProvincia" many-table="regionProvincia" many-key="idRegion" /> </field> </class>
The problem is:
When I try add a new province, with the method
addNewProvince(Province p).
I have the next exception:
org.exolab.castor.jdo.ObjectNotPersistentException:
The object of type java.util.Vector is not persistent -- it was not queried or
created within this transaction
at org.exolab.castor.persist.TransactionContext.writeLock(TransactionContext.java:886) at org.exolab.castor.persist.ClassMolder.preStore(ClassMolder.java:1368) at org.exolab.castor.persist.LockEngine.preStore(LockEngine.java:697) at org.exolab.castor.persist.TransactionContext.prepare(TransactionContext.java:1071) at org.exolab.castor.jdo.engine.DatabaseImpl.commit(DatabaseImpl.java:469) at artesanos.TestBD.<init> at artesanos.TestBD.main Some body know what is the problem ??
Thank you for all !!
FEC :))
------------------------------------------------------------
Federico E. Carpi LIFIA - Laboratorio de Investigación y Formación en Informática Avanzada Facultad de Informática - UNLP (54) 221 4228252 int 39 La Plata - Buenos Aires - Argentina ------------------------------------------------------------ |
- Re: [castor-dev] Error with mapping ? Federico E. Carpi
- Re: [castor-dev] Error with mapping ? Frédéric Augé
- Re: [castor-dev] Error with mapping ? Thomas Yip