Bruce,
I send you more details:
Code of the Query and update
-----------------------------------------------
oql=db.getOQLQuery("select n from castor.Actor
n");
results=oql.execute(); //return ~40 Objects
Object o;
while(results.hasMoreElements())
{
o=((Object)results.next());
v.add(o);
}
castor.Actor
actor=(castor.Actor)vector.elementAt(5);// 1 or 2 ...
I have the problem
db.update(actor);
-----------------------------------------------
Class
------------------------------------------------
ackage castor;
import java.util.Vector;
import java.util.Enumeration;
import org.exolab.castor.jdo.Database;
import org.exolab.castor.jdo.Persistent;
import org.exolab.castor.jdo.TimeStampable;
import java.io.Serializable;
import java.util.Date;
/**
* <p>Title: </p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2002</p>
* <p>Company: </p>
* @author unascribed
* @version 1.0
*/
public class Actor implements Persistent,
Serializable,TimeStampable,GetId
{
private long timeStamp;
private Database _db;
private long _id;
private String _actorId;
private String _firstName1;
private String _firstName2;
private String _lastName1;
private String _lastName2;
private String _emailAddress;
private String _otherAffiliation;
private String _otherAffiliationContact;
private String _otherAffiliationPhone;
private String _otherAffiliationEmail;
private String _notes;
private Integer _deleted;
private Date _creationDate;
private Date _updateDate;
private String _contactName;
private String _contactTitle;
private Integer _status;
private Address _address;
private java.util.Vector _telephones=new
java.util.Vector();
public Actor()
{
}
public long getId()
{
return _id;
}
public void setId(long id )
{
_id = id;
}
public void jdoUpdate()
{
}
public void jdoBeforeCreate( Database db )
{
}
public void jdoAfterCreate()
{
}
public void jdoStore(boolean modified)
{
}
public void jdoBeforeRemove()
{
}
public void jdoAfterRemove()
{
}
public Class jdoLoad(short accessMode)
{
return null;
}
public void jdoPersistent( Database db )
{
_db = db;
}
public long jdoGetTimeStamp()
{
return timeStamp;
}
public void jdoSetTimeStamp(long newTimeStamp)
{
timeStamp=newTimeStamp;
}
public void jdoTransient()
{
_db = null;
}
public void setActorId(String actorId)
{
this._actorId = actorId;
}
public String getActorId()
{
return _actorId;
}
public void setFirstName1(String firstName1)
{
this._firstName1 = firstName1;
}
public String getFirstName1()
{
return _firstName1;
}
public void setFirstName2(String firstName2)
{
this._firstName2 = firstName2;
}
public String getFirstName2()
{
return _firstName2;
}
public void setLastName1(String lastName1)
{
this._lastName1 = lastName1;
}
public String getLastName1()
{
return _lastName1;
}
public void setLastName2(String lastName2)
{
this._lastName2 = lastName2;
}
public String getLastName2()
{
return _lastName2;
}
public void setEmailAddress(String emailAddress)
{
this._emailAddress = emailAddress;
}
public String getEmailAddress()
{
return _emailAddress;
}
public void setOtherAffiliation(String
otherAffiliation)
{
this._otherAffiliation = otherAffiliation;
}
public String getOtherAffiliation()
{
return _otherAffiliation;
}
public void setOtherAffiliationContact(String
otherAffiliationContact)
{
this._otherAffiliationContact =
otherAffiliationContact;
}
public String getOtherAffiliationContact()
{
return _otherAffiliationContact;
}
public void setOtherAffiliationPhone(String
otherAffiliationPhone)
{
this._otherAffiliationPhone =
otherAffiliationPhone;
}
public String getOtherAffiliationPhone()
{
return _otherAffiliationPhone;
}
public void setOtherAffiliationEmail(String
otherAffliliationEmail)
{
this._otherAffiliationEmail =
otherAffliliationEmail;
}
public String getOtherAffiliationEmail()
{
return _otherAffiliationEmail;
}
public void setNotes(String notes)
{
this._notes = notes;
}
public String getNotes()
{
return _notes;
}
public void setDeleted(Integer deleted)
{
this._deleted = deleted;
}
public Integer getDeleted()
{
return _deleted;
}
public void setCreationDate(Date creationDate)
{
this._creationDate = creationDate;
}
public java.util.Date getCreationDate()
{
return _creationDate;
}
public void setUpdateDate(Date updateDate)
{
this._updateDate = updateDate;
}
public java.util.Date getUpdateDate()
{
return _updateDate;
}
public void setContactName(String contactName)
{
this._contactName = contactName;
}
public String getContactName()
{
return _contactName;
}
public void setContactTitle(String contactTitle)
{
this._contactTitle = contactTitle;
}
public String getContactTitle()
{
return _contactTitle;
}
public void setStatus(Integer status)
{
this._status = status;
}
public Integer getStatus()
{
return _status;
}
public void setAddress(Address address)
{
this._address = address;
}
public Address getAddress()
{
return _address;
}
public void addTelephones(Telephone telephone)
{
this._telephones.add( telephone );
telephone.setActor(this);
}
public java.util.Vector getTelephones()
{
return _telephones;
}
}
------------------------------------------------
Mapping file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapping PUBLIC "-//EXOLAB/Castor Object
Mapping DTD Version 1.0//EN"
"http://castor.exolab.org/mapping.dtd">
<mapping>
<class name="castor.Actor" identity="id"
key-generator="MAX" access="shared"
auto-complete="false">
<description>Actor definition</description>
<cache-type type="none"/>
<map-to table="actor" xml="actor" />
<field name="id" type="long" required="false"
direct="false" lazy="false" transient="false">
<sql name="id" type="bigint"
read-only="false" dirty="check" />
<xml name="id" node="attribute" />
</field>
<field name="actorId" type="string"
required="false" direct="false" lazy="false"
transient="false">
<sql name="actor_id" type="char"
read-only="false" dirty="check" />
<xml name="actorId" node="element" />
</field>
<field name="firstName1" type="string"
required="false" direct="false" lazy="false"
transient="false">
<sql name="first_name1" type="char"
read-only="false" dirty="check" />
<xml name="firstName1" node="element" />
</field>
<field name="firstName2" type="string"
required="false" direct="false" lazy="false"
transient="false">
<sql name="first_name2" type="char"
read-only="false" dirty="check" />
<xml name="firstName2" node="element" />
</field>
<field name="lastName1" type="string"
required="false" direct="false" lazy="false"
transient="false">
<sql name="last_name1" type="char"
read-only="false" dirty="check" />
<xml name="lastName1" node="element" />
</field>
<field name="lastName2" type="string"
required="false" direct="false" lazy="false"
transient="false">
<sql name="last_name2" type="char"
read-only="false" dirty="check" />
<xml name="lastName2" node="element" />
</field>
<field name="emailAddress" type="string"
required="false" direct="false" lazy="false"
transient="false">
<sql name="email_address" type="char"
read-only="false" dirty="check" />
<xml name="emailAddress" node="element" />
</field>
<field name="otherAffiliation" type="string"
required="false" direct="false" lazy="false"
transient="false">
<sql name="other_affiliation" type="char"
read-only="false" dirty="check" />
<xml name="otherAffiliation" node="element"
/>
</field>
<field name="otherAffiliationContact"
type="string" required="false" direct="false"
lazy="false" transient="false">
<sql name="other_affiliation_contact"
type="char" read-only="false" dirty="check" />
<xml name="otherAffiliationContact"
node="element" />
</field>
<field name="otherAffiliationPhone"
type="string" required="false" direct="false"
lazy="false" transient="false">
<sql name="other_affiliation_phone"
type="char" read-only="false" dirty="check" />
<xml name="otherAffiliationPhone"
node="element" />
</field>
<field name="otherAffiliationEmail"
type="string" required="false" direct="false"
lazy="false" transient="false">
<sql name="other_affiliation_email"
type="char" read-only="false" dirty="check" />
<xml name="otherAffiliationEmail"
node="element" />
</field>
<field name="notes" type="string"
required="false" direct="false" lazy="false"
transient="false">
<sql name="notes" type="char"
read-only="false" dirty="check" />
<xml name="notes" node="element" />
</field>
<field name="deleted" type="integer"
required="false" direct="false" lazy="false"
transient="false">
<sql name="deleted" type="tinyint"
read-only="false" dirty="check" />
<xml name="deleted" node="element" />
</field>
<field name="creationDate" type="date"
required="false" direct="false" lazy="false"
transient="false">
<sql name="creation_date" type="date"
read-only="false" dirty="check" />
<xml name="creationDate" node="element" />
</field>
<field name="updateDate" type="date"
required="false" direct="false" lazy="false"
transient="false">
<sql name="update_date" type="date"
read-only="false" dirty="check" />
<xml name="updateDate" node="element" />
</field>
<field name="contactName" type="string"
required="false" direct="false" lazy="false"
transient="false">
<sql name="contact_name" type="char"
read-only="false" dirty="check" />
<xml name="contactName" node="element" />
</field>
<field name="contactTitle" type="string"
required="false" direct="false" lazy="false"
transient="false">
<sql name="contact_title" type="char"
read-only="false" dirty="check" />
<xml name="contactTitle" node="element" />
</field>
<field name="status" type="integer"
required="false" direct="false" lazy="false"
transient="false">
<sql name="status" type="tinyint"
read-only="false" dirty="check" />
<xml name="status" node="element" />
</field>
<!-- Actor has reference to Address 1 to 1
-->
<field name="address" type="castor.Address"
required="false" direct="false" lazy="false"
transient="false">
<sql name="address_id" read-only="false"
dirty="check" />
<xml name="address" node="element" />
</field>
<!-- Actor has reference to Telephone 1 to
N-->
<field name="telephones"
type="castor.Telephone" required="false"
direct="false" lazy="false" collection="vector"
transient="false">
<sql many-key="actor_id" read-only="false"
dirty="check" />
<xml name="telephones" node="element" />
</field>
</class>
</mapping>
_________________________________________________________
Do You Yahoo!?
Informaci�n de Estados Unidos y Am�rica Latina, en Yahoo! Noticias.
Vis�tanos en http://noticias.espanol.yahoo.com
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev