anorm Questions
4
Solved
I have a class User:
case class User (id: Int, name: String)
And I would like to map the rows from a query using Anorm Stream API. I have tried with this code:
val selectUsers = SQL("SELECT id,...
Com asked 3/6, 2011 at 14:14
2
Solved
I am using Anorm for database queries in my Play application. I went through some tutorials it is given that SQL(....).execute() returns Boolean if execution was succesful. I tested the method but ...
Floret asked 12/10, 2013 at 10:17
2
Solved
I just started working with play, and I modified the way I'm doing a SQL read and I'm now getting the following error:
[Exception: DB plugin is not registered.]
The code I have for this class is...
Criticism asked 25/3, 2012 at 19:5
1
Solved
Let's say that I have the following methods:
On a WebsitesList model:
def create(urls: List[String]) = DB.withTransaction(implicit c => {
val websites = urls.map(Website.create(_))
val listI...
Druce asked 12/9, 2013 at 3:52
3
Solved
I'm studying a little the anorm documentation (from play framework) and is not clear if it supports a common query use case: dynamic filters, that is the user fills in 2 or 3 search criteria on a 1...
Dunghill asked 22/11, 2012 at 16:17
2
Solved
http://woss.name/2012/04/02/retrieving-bigdecimals-from-a-database-with-anorm-scala/
object Site {
val allFieldsParser = {
get[Pk[Long]]("sites.id") ~ // Help me parse this syntax
get[String]("...
1
Solved
Having read this quote on HashTrieMaps on docs.scala-lang.org:
For instance, to find a given key in a map, one first takes the hash code of the key. Then, the lowest 5 bits of the hash code are ...
Kilmarx asked 4/2, 2013 at 12:42
3
Solved
I see anorm is not a ORM framework, it is querying data directly by SQL. For most of the application/website, we should not query the database everytime, we needs to cache the data either by SQL or...
Corydon asked 27/11, 2012 at 6:42
2
I am currently Play!ing with Play 2.0 (Scala). I must admit that it's a lot of fun. I have a question though related to database operations exceptions.
Let's say I have Car as a domain class and t...
Fado asked 16/7, 2012 at 19:56
2
Solved
I'm just getting started with Anorm and parser combinators. It seems like there is an awful lot of boilerplate code. For example, I have
case class Model(
id:Int,
field1:String,
field2:Int,
/...
Reinhart asked 23/10, 2012 at 15:49
1
I've been having a look at the computer-database sample and I noticed that in order to reuse the Computer parser, the list method uses the Computer.withCompany parser, which returns a tuple of (Com...
Ruphina asked 2/10, 2012 at 1:48
1
Solved
In Play framework 2.0, I'm trying to load a real (i.e. single precision float) type column from PostgreSQL using a row parser like this:
case class Foo(bar: Float)
object Foo {
def all = DB.with...
Filomena asked 24/6, 2012 at 19:12
1
Solved
I'm writing Playframework 2.0 application using Scala and Anorm to access db.
Currently I'm using Pk[Long] for id fields and I'm worry about additional get call needed to access actual value. So ...
Miramontes asked 23/6, 2012 at 9:4
2
Solved
It seems that all the sample applications provided by the Play! framework make use of anorm for persistence. What is the reason for choosing anorm over an ORM? If you are using an ORM, what are you...
Rna asked 8/6, 2012 at 16:4
1
Solved
From http://www.playframework.org/documentation/2.0/ScalaTodoList
What does the "~" do and why I don't need a point before map?
val task = {
get[Long]("id") ~
get[String]("label") map {
case ...
Zeke asked 15/4, 2012 at 15:32
1
Solved
I am using the Play! framework along with Anorm to access the database. I often see examples like the following where object members are injected into the SQL statement directly.
My question is, a...
Eschew asked 25/3, 2012 at 0:28
1
Solved
I found that the row parsers of play2's anorm depend on the meta data returned by jdbc driver.
So in the built-in sample "zentasks" provided by play, I can find such code:
object Project {
val s...
Cementum asked 12/2, 2012 at 7:0
1
Solved
The table is defined as follows:
CREATE TABLE Session (
id bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
something varchar(32),
PRIMARY KEY (id)
);
And my query looks like this:
SQL("SELECT s...
Glioma asked 11/2, 2012 at 23:14
© 2022 - 2024 — McMap. All rights reserved.