Skip to content

nischalbasnet/play-scalikejdbc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sample playframework app with scalikejdbc with component interface binding

=================================

Steps to run:

  1. Make copy of application.conf.example, remove .example and update with proper db info
  2. Go to project root and run using "sbt run"
  3. Application with run at "localhost:9000"

Components:

=================================

1. Controller
  • Handles users request and passes the request to Service component to perform work
2. Service
  • Takes request from Controller and uses different components DAOs and other services to full fill the request
3. DAO
  • Performs action to retreive and save data from different sources
  • Contains different contracts/interfaces for Read and Write so that sources can adhere to one that make sense to them
Components talk to each other using interface and the concrete implementation is bind using module DIBindingModule class

Note:

Contains implicit class SqlHelpers.SQLResultExtension to allow for insert/update operation using scalikejdbc.SQLToResult class that is needed in order to allow us to insert and get autogenerated primary key that is not long.
Contians implicit reader and writer for joda DateTime in com.nischal.JsonReaderWriter to properly read postgres timestamptz with format => 'yyyy-MM-dd'T'HH:mm:ss.SSSSSSZ'