Questions tagged [squeryl]

Squeryl is a strongly typed, declarative and SQL like DSL for manipulating database objects from within the Scala language.

Squeryl is a strongly typed, declarative and SQL like DSL for manipulating database objects from within the Scala language.

201 questions
0
votes
1 answer

Is there any simple way to validate field length with squeryl?

I'm using squeryl with playframework, and defined some entifies: case class User(name:String, age:Int, ...) extends KeyedEntity[Long] { val id = 0 } The length of name field defined as varchar(50) in database. Since we need to validate the values…
Freewind
  • 193,756
  • 157
  • 432
  • 708
0
votes
2 answers

How can i use one sequence to auto increment several tables in squeryl (PostgreSQL)?

I have follows val s1 = autoIncremented("advert_id_seq") on(car)(attributes => declare(attributes.id is (s1))) on(danceInstructor)(attributes => declare(attributes.id is (s1))) When i run my app a catch following…
kraken
  • 484
  • 7
  • 18
0
votes
1 answer

Using Squeryl with Akka Actors

So I'm trying to work with both Squeryl and Akka Actors. I've done a lot of searching and all I've been able to find is the following Google Group post: https://groups.google.com/forum/#!topic/squeryl/M0iftMlYfpQ I think I might have shot myself in…
djsumdog
  • 2,560
  • 1
  • 29
  • 55
0
votes
2 answers

How to practicaly handle List[FieldError] in Lift with Squeryl

I'm new to both Lift and Squeryl. I was following the example on the lift cookbook on how to create a Schema and some tables. I managed to do so and to insert records, this is my schema code: object PortfolioSchema extends Schema { val…
Ende Neu
  • 15,581
  • 5
  • 57
  • 68
0
votes
1 answer

how to implement @MappedSuperClass in squeryl?

I have 12 tables in the database. and all tables has same columns and same relations. So I had writen the code in JPA. @MappedSuperclass public class BaseAddress { ... properties and relations (@ManyToOne / @OneToMany) } @Entity public class…
xyzlast
  • 680
  • 1
  • 8
  • 18
0
votes
1 answer

Issue with @Column annotations in Squeryl with Play Framework and MySQL

I'm currently using : - Scala v2.10 - Squeryl v 0.9.6 - MySQL Connector v5.1.28 I'have defined my model class like this: class identities ( val user_id: Long, val changed: String, val del : Long, val standard : Long, val name :…
Vittorio Cozzolino
  • 931
  • 1
  • 14
  • 31
0
votes
2 answers

How to define Squeryl schemas for two different db in Play

I'd like to add a second temporary DB (filebased H2) to our Play 2.1 app. But can't figure out how and where to create a Squeryl schema for the second DB. The first schema is already defined in a scala class that extends org.squeryl.Schema. Where…
alboko
  • 488
  • 5
  • 15
0
votes
1 answer

How to implement a generic REST api for tables in Play2 with squeryl and spray-json

I'm trying to implement a controller in Play2 which exposes a simple REST-style api for my db-tables. I'm using squeryl for database access and spray-json for converting objects to/from json My idea is to have a single generic controller to do all…
Geir
  • 514
  • 4
  • 18
0
votes
2 answers

Squeryl doesn't detect annotated val constructor argument as transient

I have a class with a constructor parameter like this: @Transient val applicationType: Option[String] = None, However, Squeryl doesn't notice the @Transient annotation, and still tries to read the value of this field from the database. But there is…
Robin Green
  • 32,079
  • 16
  • 104
  • 187
0
votes
2 answers

Dynamic orderBy with Squeryl

I can not figure out how to change orderBy dynamically in runtime. I need something like: def samplesSorted(fields: List[String]) = { from(Schema.samples)(s => select(s) orderBy(fields.map(getterByName)) } Or something like def…
voronaam
  • 111
  • 1
  • 5
0
votes
3 answers

Scala and squeryl MySQL connection drops and cannot reconnect after about 10 minutes

I create a mysql connection with the following lines successfully Factory Session Code val session = Session.create( DriverManager.getConnection(url, user, pass), new CustomMySqlAdapter ) I am using…
Victor 'Chris' Cabral
  • 2,135
  • 1
  • 16
  • 33
0
votes
1 answer

No Class Definitions found scala/reflect/ClassManifest using play 2 bars tutorial

I'm trying to build the bars tutorial project from "Getting Started with Play 2, Scala, and Squeryl" by James Ward, Ryan Knight July 11, 2012. I can get it to work okay until I enter the URL for the bars list (//localhost:9000/bars). At that point I…
Bob Nicholson
  • 163
  • 11
0
votes
1 answer

squeryl: Error while update column with concatenated string

I am trying to use squeryl and update a column with another value concatenated with a string. So at first I tried this (simplified/contrived example): update(songs)(s => where(s.name isNull) set(s.year_str := Some(s.default_year + " AD")) This…
calvinkrishy
  • 3,798
  • 8
  • 30
  • 45
0
votes
1 answer

How to get the correct DB2/400 library(database) using Squeryl Client

I've installed Squeryl Client and can easily access my iSeries DB2/400 and select and see the data within the tables. However, it seems I have to modify the URL in the alias every time I want to change from one library(database) to another. If I…
Bob Nicholson
  • 163
  • 11
0
votes
1 answer

Squeryl: left outer join for Option[Long] value

I'm trying to implement a request like in example in documentation: http://squeryl.org/joins.html I have a table "Requisite" and "Service". In field "paymentRequisite" of table Service could be a link to row of Requisite or…
Pavel Varchenko
  • 727
  • 1
  • 11
  • 21