Hi there!
I made a couple of hacks to Castor-0.9.5 so I don't need to specify a
set-method and xml-only fields are not attempted loaded in types mapped
to both table and xml.
Here is an example-mapping:
<class name="Course" auto-complete="false" identity="ID"
key-generator="IDENTITY">
<cache-type type="time-limited" capacity="3600"/>
<map-to table="course" xml="course"/>
<field name="ID" type="integer" key-generator="identity">
<sql name="course_id"/>
<bind-xml name="course_id"/>
</field>
<field name="startWeek" type="integer">
<sql name="start_week"/>
<bind-xml name="start_week"/>
</field>
<field name="startYear" type="integer">
<sql name="start_year"/>
<bind-xml name="start_year"/>
</field>
<field name="startDate" type="date" get-method="getStartDate">
<bind-xml name="start"/>
</field>
</class>
startDate is just a get-method, set at runtime from startWeek and
startYear and thus not stored in the database.
Instead of throwing an exception in FieldMolder when it can't find a
set-method I've just commented out the throw-clause (In the Constructor
and setValue).
The other hack is in the SQLEngine-constructor and it now only test for
JDOFieldDescriptor-type:
if (fieldDescriptors[i] instanceof JDOFieldDescriptor /*&&
(fieldDescriptors[i].getClassDescriptor() != null) */)
Any comments and/or alternative methods of doing this?
Stein
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev
- Re: [castor-dev] A couple of hacks Stein M. Eliassen
- Re: [castor-dev] A couple of hacks Techeira, Vincent X -ND
