RelationalList fields can't be read only?

3 views
Skip to first unread message

JNL

unread,
May 8, 2007, 3:19:47 AM5/8/07
to jmatter
Hi Eitan,

I'm not 100% sure yet, but I don't think the Harvester can handle
definining RelationalList fields as read only, using the public static
string[] readOnly directive. Have just been debugging a genhbm error
and tracked it down to harvestFields() line 206-ish, where it casts
read-only fields to CompositeField type, before calling
setReadOnly(true). In my case, both of my list fields have been
instantiated as IndexedFields a bit further up, so the cast fails with
invalid type. Does it actually make sense to have a read-only
IndexedField? If not, I guess you just need to protect the
setReadOnly() call.

This is the exact error I was getting, with some added debug info.

[java] harvesting descriptor: history
[java] Field is indexed-false
[java] Setting tabView...
[java] Setting readOnly...
[java] java.lang.ClassCastException: com.u2d.field.IndexedField
[java] at
com.u2d.model.Harvester.harvestFields(Harvester.java:217)
[java] at com.u2d.model.ComplexType.harvest(ComplexType.java:
164)
[java] at com.u2d.model.ComplexType.<init>(ComplexType.java:
131)
[java] at com.u2d.model.ComplexType.forClass(ComplexType.java:
92)
[java] at com.u2d.persist.HBMMaker.<init>(HBMMaker.java:43)
[java] at
com.u2d.persist.HBMGenerator.processClassList(HBMGenerator.ja
va:40)
[java] at com.u2d.persist.HBMGenerator.main(HBMGenerator.java:
71)

Cheers,

Justin

Eitan Suez

unread,
May 8, 2007, 10:07:50 AM5/8/07
to jma...@googlegroups.com
hi justin,
  again, thanks for so meticulously finding these
  holes.  yes, i need to add support for readOnly
  on indexed fields...  as you suggest i will first
  replace the classcast with a warning message.
/ eitan
Reply all
Reply to author
Forward
0 new messages