db-jdo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthew Adams <matt...@matthewadams.me>
Subject Re: Instead of using 'java.util.List', what if using a special List, e.g., 'scala.collection.immutable.List'
Date Tue, 08 Feb 2011 15:25:29 GMT
Hi,

The JDO specification provides mandatory or optional support for most
of the collection types provided by the JDK.  For other types, like
scala.collection.immutable.List, you would have to look at your chosen
implementation for support.

I noticed that you indicated that the JPOX enhancer is in use.  FYI,
JPOX is now DataNucleus (www.datanucleus.org), the reference
implementation for JDO, which is known to support many other types
that just those called for by the specification.

HTH,
Matthew

On Mon, Feb 7, 2011 at 5:51 PM, Myoungkyu Song <mksong@vt.edu> wrote:
> 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>
> ================================================
>



-- 
mailto:matthew@matthewadams.me
skype:matthewadams12
yahoo:matthewadams
aol:matthewadams12
google-talk:matthewadams12@gmail.com
msn:matthew@matthewadams.me
http://matthewadams.me
http://www.linkedin.com/in/matthewadams

Mime
View raw message