A multi-tenant application with Play2 Scala Slick

164 views
Skip to first unread message

Guillaume Badin

unread,
Apr 7, 2014, 5:13:45 AM4/7/14
to scala...@googlegroups.com
Hello everybody, 

I wanted to implement a multi-tenant application with Slick. (last version 2.01). With hibernate it will be easy because we have hibernate filters but with Slick i don't know what is the best way to implement my service. 

Could you give me some advice ? 

Christopher Vogt

unread,
Apr 7, 2014, 2:43:26 PM4/7/14
to scala...@googlegroups.com
I am not sure what you have in mind exactly and it is the first time I
am looking at
http://docs.jboss.org/hibernate/orm/3.6/reference/en-US/html/filters.html

But it seems to me this shoulnd't be hard with slick. To mimic part of
their example (Config is a class you define):

def applyFilter[T,E](config:Config, q: Query[T,E]) =
q.filter(r => config.minLength <= r.length &&
config.maxLength >= r.length
)

def getForests = db.withSession{ implicit session =
applyFilter( config, someQuery ).list.toSet
}
Reply all
Reply to author
Forward
0 new messages