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
2 answers

Scala and persistence framework version incompatible

I try to use slick and squeryl framework for data persistence with scala. I don't want to use Play framework, but just the persistence framework, but when I import slick (or squeryl) jar file, I encountered the issue below: slick_2.10.1-2.0.0-M1.jar…
Sy Z
  • 441
  • 1
  • 5
  • 10
0
votes
1 answer

WIth Squeryl (using Lift), how can I make two model classes a subclass of the same class?

Using Lift with Squeryl, how can I make two classes a subclass of the same class? My classes look like the following: class SubClass1 extends Record[SubClass1] with KeyedRecord[SubClass1] with CreatedUpdated[SubClass1] { val id = ... val…
Shafique Jamal
  • 1,550
  • 3
  • 21
  • 45
0
votes
0 answers

How can I map inherited model to entity using Scala and Squeryl?

I have the model User on my system that has a OneToMany relationship with Role, role is currently a trait and I have other roles inherinting from it: AdministratorRole, VisitorRole, ResidentRole. My doubt is how can I model (best way) this system to…
adheus
  • 3,985
  • 2
  • 20
  • 33
0
votes
1 answer

What is the best way to build a model/entity in Scala to map with Squeryl?

I'm very new to Scala, Play Framework and Squeryl. I already understand the concepts of val and var, but I'm having a hard time on trying to model my entities. As I saw on Squeryl documentation, sometimes they use var on id and other times use val.…
adheus
  • 3,985
  • 2
  • 20
  • 33
0
votes
1 answer

Squeryl Many to Many: compositeKey(field1, field2) doesn't exist

I'm learning Scala (2.11) and the Play Framework, and i'm trying to implement a Many to Many relation between Person and Skill with Squeryl (0.9.5-7). Multiple Persons can share Skills, and a Person can have many Skills. The Squeryl docs tell me to…
ZvL
  • 793
  • 2
  • 11
  • 25
0
votes
1 answer

Squeryl: Typed Primary keys

I would like to define my Primary Keys as specific types - not just Long or String For example case class Project( var id: ProjectId = 0, One advantage of this is if I accidently compare different keys - then the compiler will…
brent
  • 1,095
  • 1
  • 11
  • 27
0
votes
1 answer

Squeryl Foreign Key onDelete cascade doesn't work

i have a User and a Device Table. If a User connects to a Device, the Device will know its User (Foreign Key). A Device can only have one User. I create a Foreign Key with userToDevice.foreignKeyDeclaration.constrainReference(onDelete cascade) it…
B. Kemmer
  • 1,517
  • 1
  • 14
  • 32
0
votes
1 answer

How to implement master/slave structure with squeryl and play framework

I am running a play framework website that uses squeryl and mysql database. I need to use squeryl to run all read queries to the slave and all write queries to the master. How can I achieve this? either via squeryl or via jdbc connector itself.…
Anas Jaghoub
  • 138
  • 1
  • 1
  • 8
0
votes
1 answer

Select Query always runs into RuntimeException

I always run into RuntimeException when i invoke following query: val app = from(appTable)(app => where (app.id === application_ID) select(app)).single This query always throws a RuntimeException: java.lang.RuntimeException: next called…
B. Kemmer
  • 1,517
  • 1
  • 14
  • 32
0
votes
1 answer

scalatra < squeryl < select ALL | Always

I want to read elements from the database and return them as JSON objects. Scalatra is set up to return JSON. Databaseschema is created. Players are added. The following code seems to be the main problem: get("/") { inTransaction { …
eventhorizon
  • 2,977
  • 8
  • 33
  • 57
0
votes
1 answer

Finding the current status of each phone number in PostgreSQL

Terminology: msisdn = phone number First I'd like to apologize for the names. This Database schema was created using the squeryl ORM and it has some interesting table definition choices. I've included the two relevant tables below. Basically,…
djsumdog
  • 2,560
  • 1
  • 29
  • 55
0
votes
1 answer

Squeryl order by multiple columns

I need to order by 2 fields: SELECT * FROM item ORDER BY date ASC, sequence DESC; Is it possible to emulate this SQL with Squeryl?
Alexander
  • 452
  • 6
  • 15
0
votes
1 answer

What can cause the Squeryl table object to be not found?

I am encountering a compile time error while attempting to get Squeryl example code running. The following code is based on the My Adventures in Coding blog post about connecting to SQLServer using Squeryl. import…
Peter Beacom
  • 41
  • 1
  • 9
0
votes
1 answer

Squeryl cascading delete on application level

Squeryl provides functionality for declaration of database cascade mechanism. All you must to do is just invoke next methods: relation_name.foreignKeyDeclaration.constrainReference(onDelete cascade) where relation_name is ie oneToManyRelation…
baju
  • 511
  • 5
  • 19
0
votes
1 answer

Cast a squeryl Query to a case class scala

I am new to Squeryl and trying to figure out how to cast the results I get back from a query into case class. I have something like this def getUsers = { val data = getUserData ... } def getUserData = { transaction { …
user1875195
  • 968
  • 4
  • 8
  • 22