3

I'm using Scalatra + Riak. Scalatra uses case classes to map request (json) data to/from, while the Riak client uses pojos to map json data to/from the database. Instead of having both case classes and pojos, is there a way to use one or the other, thus eliminating redundancy? Thanks.

Ari
  • 3,671
  • 8
  • 31
  • 51

1 Answers1

1

I would suggest for you to go for the scala client with riak which seemingly uses case classes too: http://riak.scalapenos.com/examples.html . Also it will allow you to keep everything in Scala.

Or if that's not possible, you can find JSON libraries for pojos, and then return strings from your Servlets. E.g. http://jackson.codehaus.org/ or look at this question

Community
  • 1
  • 1
Balint Pato
  • 1,418
  • 1
  • 13
  • 26