HowTo: Custom Field in Lift-Record-Squeryl

I am trying to create an EnumListField in Lift / Record / Squeryl, similar to MappedEnumList in LiftMapper. Storage type must be long / BIGINT. I understand that if I define:

def classOfPersistentField = classOf[Long] 

Squeryl will then know that it must create a BIGINT column. And I know that it uses setFromAny () to set the value passing in Long. The only thing I do not get is:

How will he read the value of the field? If he uses a valueBox, he will get Seq [Enum # Value], and he will not know how to turn it into Long.

How do I pass Squeryl to convert my Seq [Enum # Value] to Long, or define a โ€œgetterโ€ that returns Long and does not conflict with a โ€œnormalโ€ getter (s)?

+80
scala record lift squeryl
Apr 17 '11 at 11:40
source share

No one has answered this question yet.

See similar questions:

0
Squeryl Custom Field Types

or similar:

419
How to get the last N entries in mongodb?
149
Why should I use Scala / Elevator over Java / Spring?
23
How to simulate bit fields in Delphi records?
3
Setting Transaction Isolation Level in Squeryl
3
Mapper vs Write / Squeryl
one
Checking the general field using signs in the elevator
one
MongoDB elevator stores heterogeneous data lists
0
Squeryl Custom Field Types
0
How to Handle List [FieldError] Practically in Lift with Squeryl
0
Lift Squeryl-Record select with google user id



All Articles