Hello,
I have the project on sf.net - Castor Framework
(http://sourceforge.net/projects/phantom-castor)
I have in JDOWorker method getIdentity. This method return value of id
through castor mapping. But it does not work correctly.

Here is my method:

  /**
   * REturn identity for given object
   * @param o Object (must be not null)
   * @return Identity key value
   * @throws JDOException if class descriptor or identity decriptor not
found in mapping
   */
  public Object getIdentity(Object o) {
    assert o != null;
    ClassDescriptor classDescriptor =
jdoConfiguration.getJDOClassDescriptor(o.getClass());
    if (classDescriptor == null) {
      throw new JDOException("The " + o.getClass() + " not found in
mapping");
    }
    FieldDescriptor identityDescriptor = classDescriptor.getIdentity();
    if (identityDescriptor == null) {
      throw new JDOException("No identity defined in mapping for " +
o.getClass());
    }
    return identityDescriptor.getHandler().getValue(o);
  }

if I use mapping:
<field name="id" type="string">
  <sql name="id" type="char" />
</field>
all work ok. getIdentity return type java.lang.String, but for:
<field name="id" type="string">
  <sql name="id" type="integer" />
</field>
method get Identity return java.lang.Integer, but java.lang.String
needed.

Maybe I have wrong method?

Thanks!

PS. JDK 1.4.1_01, Windows 2000/XP, Castor 0.9.4.1, mySQL

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to