db-jdo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Myoungkyu Song <mks...@vt.edu>
Subject Instead of using 'java.util.List', what if using a special List, e.g., 'scala.collection.immutable.List'
Date Mon, 07 Feb 2011 23:51:08 GMT
Hello,

I would like to ask about the one-to-many relationship in JDO. The
below code is a actual working code.
Instead of using 'java.util.List', what if I use a special List, for
example 'scala.collection.immutable.List'
as a collection? As my test, jpox enhancer said, "..has been defined
with "collection" MetaData yet is not a Collection Field."

Best regards,
Myoungkyu

================================================
* in the java class:
------------------------------------------------------------------------------------------------
import java.util.List;

List<ChildModel> children;
------------------------------------------------------------------------------------------------
*.jdo XML file:
------------------------------------------------------------------------------------------------
<class ...>
   ...
   <field name="children" persistence-modifier="persistent">
       <collection element-type="scalajdo.ChildModel"/>
       <join/>
   </field>
</class>

<class name="ChildModel" table="CHILDMODEL" identity-type="application">
       <field name="modelId" persistence-modifier="persistent"
primary-key="true">
               <column name="MODELID"/>
       </field>

  <field name="value" persistence-modifier="persistent">
       <column name="VALUE"/>
  </field>
</class>
================================================

Mime
View raw message