Collection of Strings (bug?)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Collection of Strings (bug?)

Thomas TRIPLET
Hello,

I'm trying to create new classes in my data model and I'd like to include a collection of strings. UNfortunately, this doesn't seem possible. I've tried the following  combinations, with no luck:
  • <collection name="items" type="java.lang.String"/>
  • <collection name="items" referenced-type="java.lang.String"/>
  • <collection name="items" referenced-type="String"/>
The only solution I've found is to encapsulate the strings into a dedicated "fake" class, but this is not very convenient. Is this a bug or is there an alternate solution?

Thanks
Thomas

--
Thomas Triplet, Ph.D.
http://www.thomastriplet.net




_______________________________________________
dev mailing list
[hidden email]
http://mail.intermine.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: Collection of Strings (bug?)

Vallejos, Andrew

Thomas,

 

A collection in InterMine is a collection of InterMine objects not Java classes.  If you need a collection, then you need a new InterMine object.

 

For example in RatMine dbSNP objects have a collection of ConsequenceTypes objects which contain a java.lang.String name attribute.

 

Hope that helps,

 

Andrew Vallejos

Web Developer

Medical College of Wisconsin

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Thomas TRIPLET
Sent: Tuesday, August 02, 2011 1:04 PM
To: [hidden email]
Subject: [InterMine Dev] Collection of Strings (bug?)

 

Hello,

 

I'm trying to create new classes in my data model and I'd like to include a collection of strings. UNfortunately, this doesn't seem possible. I've tried the following  combinations, with no luck:

  • <collection name="items" type="java.lang.String"/>
  • <collection name="items" referenced-type="java.lang.String"/>
  • <collection name="items" referenced-type="String"/>

The only solution I've found is to encapsulate the strings into a dedicated "fake" class, but this is not very convenient. Is this a bug or is there an alternate solution?

 

Thanks

Thomas


--

Thomas Triplet, Ph.D.
http://www.thomastriplet.net



_______________________________________________
dev mailing list
[hidden email]
http://mail.intermine.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: Collection of Strings (bug?)

Richard Smith
In reply to this post by Thomas TRIPLET
Hi Thomas,
You're exactly right, it isn't possible to store a collection of plain
strings.  In practice we've found we don't often need to do this e.g
when we store a value we usually associate a type or source with it as
well.

So it's not a bug and it isn't a high priority to change at the
moment.  Has anyone else on the list found this to be restrictive?

Regards,
Richard.



On 02/08/2011 19:03, Thomas TRIPLET wrote:

> Hello,
>
> I'm trying to create new classes in my data model and I'd like to include a
> collection of strings. UNfortunately, this doesn't seem possible. I've tried
> the following  combinations, with no luck:
>
>     -<collection name="items" type="java.lang.String"/>
>     -<collection name="items" referenced-type="java.lang.String"/>
>     -<collection name="items" referenced-type="String"/>
>
> The only solution I've found is to encapsulate the strings into a dedicated
> "fake" class, but this is not very convenient. Is this a bug or is there an
> alternate solution?
>
> Thanks
> Thomas
>
> --
> Thomas Triplet, Ph.D.
> http://www.thomastriplet.net
>
>
>
>
> _______________________________________________
> dev mailing list
> [hidden email]
> http://mail.intermine.org/cgi-bin/mailman/listinfo/dev


_______________________________________________
dev mailing list
[hidden email]
http://mail.intermine.org/cgi-bin/mailman/listinfo/dev