Case class serialization for Scala / SQL #54

Closed
timowest opened this Issue Nov 21, 2011 · 3 comments

Comments

Projects
None yet
3 participants
@timowest
Member

timowest commented Nov 21, 2011

In addition to the generation of normal Scala classes, case classes could be generated via a special Serializer class.

If the order of fields is the same as in the matching relational path type, it should be possible to populate it in query projections via constructor projection instead of a QBean.

Example :

object User extends QUser("user") {
    override def as(variable: String) = new QUser(variable)

}

case class User(id: Long, firstName: String, lastName: String, ...)
@timowest

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Dec 12, 2011

Member

Released in 2.3.0

Member

timowest commented Dec 12, 2011

Released in 2.3.0

@timowest timowest closed this Dec 12, 2011

@khoran

This comment has been minimized.

Show comment
Hide comment
@khoran

khoran Nov 8, 2013

How do I use this feature? I would like to have case classes generated as it looks like you have above, instead of or in addition to the normal bean classes. Thanks.

khoran commented Nov 8, 2013

How do I use this feature? I would like to have case classes generated as it looks like you have above, instead of or in addition to the normal bean classes. Thanks.

@lefou

This comment has been minimized.

Show comment
Hide comment
@lefou

lefou Nov 13, 2013

Contributor

Instead of

exporter.setBeanSerializerClass(classOf[ScalaBeanSerializer])

write this

exporter.setBeanSerializerClass(classOf[CaseClassSerializer])
Contributor

lefou commented Nov 13, 2013

Instead of

exporter.setBeanSerializerClass(classOf[ScalaBeanSerializer])

write this

exporter.setBeanSerializerClass(classOf[CaseClassSerializer])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment