lift scaffolding from existing database

Post on 15-May-2015

2.007 Views

Category:

Technology

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Lift Scaffolding from existing database

thomas.alexandre@devcode.se

Goal

Ease the “getting started” step when migrating from Java to Scala A lot of the legacy is in the Database

Among many alternatives, choose one that fits java programmers with a stack they are familiar with:

demo based on the Lift JPA sample application

Page 2

Scala-tools repositoryhttp://www.scala-tools.org/repo-releases/net/liftweb/

Page 3

lift-archetype-basic

lift-archetype-blank

lift-archetype-hellolift

lift-archetype-jpa-basic

lift-archetype-sbt

lift-archetype-jpa-blank

lift-archetype-jpa-blank-single

Scala FARM(Framework for Automatic Relational Mapping)

Features:

DOG: Domain Object Generator for JPA compliant entities (one class per table)

CAT: Testdata by extracting database data into XML files

Test code to create a lift database for your integration tests

COW: Lift scaffolding i.e. snippets for CRUD with their corresponding HTML views (list, add, search)

MOUSE: Model classes containing common Sql Queries

Third parties: scalate, configgy, dbunit

Page 4

Live coding

Page 5

ROADMAP

Page 6

Support Other Frameworks

Play

Bowler

Akka-based, e.g. Spray

Blueeyes

Page 7

Create own mappings

Page 8

Refactoring

Groovy SQL API: Sql.eachRow(GString gstring,Closure metaClosure, Closure rowClosure)

Scala:

Page 9

Refactoring, imperative style

Page 10

Functional

Page 11

Functional with defaults

Page 12

Usage of eachRow(resultSet,metaClosure,rowClosure)

Page 13

Page 14

Do You Have Any Questions?

https://github.com/ThomasAlexandre/scalafarm.git

list.scaml

Page 15

Domain Entity

Page 16

Scalate Template for Domain Entities

Page 17

etc…

top related