Custom type for NodeSeq?

13 views
Skip to first unread message

Jeppe Nejsum Madsen

unread,
Apr 4, 2013, 6:12:20 AM4/4/13
to squ...@googlegroups.com
Hi,

Trying to create a custom type for NodeSeq, I'm not having any luck. Probably because NodeSeq is an abstract class.

I can see a recent discussion about abstract classes and whether Squeryl needs to instantiate values for fields (obviously not possible for abstract classes :-).

It seems that for custom types at least, the values are instantiated by convertFromJdbc so this shouldn't be an issue.

Are there any plans to improve this? How hard would it be?

/Jeppe

Maxime Lévesque

unread,
Apr 4, 2013, 8:33:24 AM4/4/13
to Squeryl

Instantiation of field values is not the problem, methods relying on Class are all here : 

the Class of a field is used as a key to the 'registry' member, if you track the uses of FieldMapper's methods
that take Class as argument you'll get an idea, it is mainly used or "discovery" of field types.

The obvious simple workaround is to make yourself a Wrapper to a NodeSeq ....


2013/4/4 Jeppe Nejsum Madsen <je...@ingolfs.dk>


/Jeppe

--
You received this message because you are subscribed to the Google Groups "Squeryl" group.
To unsubscribe from this group and stop receiving emails from it, send an email to squeryl+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
A new scientific truth does not triumph by convincing its opponents and making them see the light, but rather because its opponents eventually die, and a new generation grows up that is familiar with it.
-- Max Plank

Jeppe Nejsum Madsen

unread,
Apr 4, 2013, 9:33:08 AM4/4/13
to squ...@googlegroups.com
On Thu, Apr 4, 2013 at 2:33 PM, Maxime Lévesque <maxime....@gmail.com> wrote:

Instantiation of field values is not the problem, methods relying on Class are all here : 

the Class of a field is used as a key to the 'registry' member, if you track the uses of FieldMapper's methods
that take Class as argument you'll get an idea, it is mainly used or "discovery" of field types.

Yeah, after some debugging I figured out that what was put in the map was something like "NodeSeq$anon1$" or something similar.
 
I guess it's probably too invasive to start using Manifests/TypeTags for these things, but would it be possible to hook into this and make it user configurable?

I don't mind making some custom setup for mappings once in the application, but I'm very reluctant to start modifying my nice posos for the sake of mapping (which I've avoided very nicely so far :-)
 
The obvious simple workaround is to make yourself a Wrapper to a NodeSeq ....

I'd rather avoid this, cf above :-)

/Jeppe
Reply all
Reply to author
Forward
0 new messages