Bruce,

Well, the first problem I ever posted to this list was the following
(http://www.mail-archive.com/[EMAIL PROTECTED]/msg11379.html):
- MediumContainer contains a list of Medium.
- A Medium can be a MediumForSound which is a Medium with a trackList.
- CompactDisc and Record extend MediumForSound, holding their specific
properties.
When the mapping for the mediumList was:
  <field name="mediumList" type="kws.mediadb.business.Medium"
collection="vector" get-method="getMediumList" set-method="setMediumList">
   <sql many-key="id_medium_container"/>
  </field>
and I tried to save a MediumContainer holding Record objects, the trackList
was not saved.

If I changed the mapping to:
  <field name="mediumList" type="kws.mediadb.business.MediumForSound"
collection="vector" get-method="getMediumList" set-method="setMediumList">
   <sql many-key="id_medium_container"/>
  </field>
the trackList was saved as it should.

So I am guessing that Castor thinks the mediumList always contains objects
of type Medium which aren't holding a trackList of course.

The second problem was linked to something I posted more recently
(http://www.mail-archive.com/[EMAIL PROTECTED]/msg13877.html and
http://www.mail-archive.com/[EMAIL PROTECTED]/msg13906.html). Apparently
this indeed was a bug.

Then someone in the list suggested me to, maybe, look at a different JDO
product and to see if that was working for me (instead of writing my own
persistency layer). So I decided to take a look at Hibernate. It appears
that Hibernate does not have the first problem I mentioned. Hibernate seems
to support polymorphism very well. You can query the database for all Medium
objects which returns a nice set of Record and CompactDisc objects. With
Castor I had to first query for all Record objects and afterwards all
CompactDisc objects, which is rather long-winded. Of course you can argue my
object model is crap, which is probably the case ;) Hey I'm not a real
programmer. This is something I do in my spare time.

So in short Hibernate solved all my problems, and it had polymorphism which
is a nice to have feature.


regards,

Kenneth

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

Reply via email to