diff options
author | Pacien TRAN-GIRARD | 2015-02-01 00:48:17 +0100 |
---|---|---|
committer | Pacien TRAN-GIRARD | 2015-02-01 00:48:17 +0100 |
commit | 4c709046fe329113113b15de62a181cfc8fa5c13 (patch) | |
tree | 2b3f7a4262802f6bf92506ad2ab67e2f043274d3 /app/models/Views.scala | |
parent | afe377a9b10b5c1b2badc74d4b9b636e7c4d0cbf (diff) | |
download | minibay-4c709046fe329113113b15de62a181cfc8fa5c13.tar.gz |
Add model code generator
Diffstat (limited to 'app/models/Views.scala')
-rw-r--r-- | app/models/Views.scala | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/app/models/Views.scala b/app/models/Views.scala new file mode 100644 index 0000000..a76b043 --- /dev/null +++ b/app/models/Views.scala | |||
@@ -0,0 +1,84 @@ | |||
1 | package models | ||
2 | // AUTO-GENERATED Slick data model | ||
3 | /** Stand-alone Slick data model for immediate use */ | ||
4 | object Views extends { | ||
5 | val profile = play.api.db.slick.Config.driver | ||
6 | } with Views | ||
7 | |||
8 | /** Slick data model trait for extension, choice of backend or usage in the cake pattern. (Make sure to initialize this late.) */ | ||
9 | trait Views { | ||
10 | val profile: scala.slick.driver.JdbcProfile | ||
11 | import profile.simple._ | ||
12 | import scala.slick.model.ForeignKeyAction | ||
13 | // NOTE: GetResult mappers for plain SQL are only generated for tables where Slick knows how to map the types of all columns. | ||
14 | import scala.slick.jdbc.{GetResult => GR} | ||
15 | |||
16 | /** DDL for all tables. Call .create to execute. */ | ||
17 | lazy val ddl = Accounts.ddl ++ Sales.ddl | ||
18 | |||
19 | /** Entity class storing rows of table Accounts | ||
20 | * @param userUuid Database column user_uuid DBType(varchar), Length(36,true), Default(None) | ||
21 | * @param balance Database column balance DBType(numeric), Default(None) | ||
22 | * @param openBids Database column open_bids DBType(numeric), Default(None) | ||
23 | * @param equity Database column equity DBType(numeric), Default(None) */ | ||
24 | case class Account(userUuid: Option[String] = None, balance: Option[scala.math.BigDecimal] = None, openBids: Option[scala.math.BigDecimal] = None, equity: Option[scala.math.BigDecimal] = None) | ||
25 | /** GetResult implicit for fetching Account objects using plain SQL queries */ | ||
26 | implicit def GetResultAccount(implicit e0: GR[Option[String]], e1: GR[Option[scala.math.BigDecimal]]): GR[Account] = GR{ | ||
27 | prs => import prs._ | ||
28 | Account.tupled((<<?[String], <<?[scala.math.BigDecimal], <<?[scala.math.BigDecimal], <<?[scala.math.BigDecimal])) | ||
29 | } | ||
30 | /** Table description of table accounts. Objects of this class serve as prototypes for rows in queries. */ | ||
31 | class Accounts(_tableTag: Tag) extends Table[Account](_tableTag, "accounts") { | ||
32 | def * = (userUuid, balance, openBids, equity) <> (Account.tupled, Account.unapply) | ||
33 | |||
34 | /** Database column user_uuid DBType(varchar), Length(36,true), Default(None) */ | ||
35 | val userUuid: Column[Option[String]] = column[Option[String]]("user_uuid", O.Length(36,varying=true), O.Default(None)) | ||
36 | /** Database column balance DBType(numeric), Default(None) */ | ||
37 | val balance: Column[Option[scala.math.BigDecimal]] = column[Option[scala.math.BigDecimal]]("balance", O.Default(None)) | ||
38 | /** Database column open_bids DBType(numeric), Default(None) */ | ||
39 | val openBids: Column[Option[scala.math.BigDecimal]] = column[Option[scala.math.BigDecimal]]("open_bids", O.Default(None)) | ||
40 | /** Database column equity DBType(numeric), Default(None) */ | ||
41 | val equity: Column[Option[scala.math.BigDecimal]] = column[Option[scala.math.BigDecimal]]("equity", O.Default(None)) | ||
42 | } | ||
43 | /** Collection-like TableQuery object for table Accounts */ | ||
44 | lazy val Accounts = new TableQuery(tag => new Accounts(tag)) | ||
45 | |||
46 | /** Entity class storing rows of table Sales | ||
47 | * @param itemUuid Database column item_uuid DBType(varchar), Length(36,true), Default(None) | ||
48 | * @param sellerUuid Database column seller_uuid DBType(varchar), Length(36,true), Default(None) | ||
49 | * @param startDate Database column start_date DBType(timestamptz), Default(None) | ||
50 | * @param endDate Database column end_date DBType(timestamptz), Default(None) | ||
51 | * @param bestBidUuid Database column best_bid_uuid DBType(varchar), Length(36,true), Default(None) | ||
52 | * @param bestBidderUuid Database column best_bidder_uuid DBType(varchar), Length(36,true), Default(None) | ||
53 | * @param bestOffer Database column best_offer DBType(numeric), Default(None) | ||
54 | * @param charges Database column charges DBType(numeric), Default(None) */ | ||
55 | case class Sale(itemUuid: Option[String] = None, sellerUuid: Option[String] = None, startDate: Option[java.sql.Timestamp] = None, endDate: Option[java.sql.Timestamp] = None, bestBidUuid: Option[String] = None, bestBidderUuid: Option[String] = None, bestOffer: Option[scala.math.BigDecimal] = None, charges: Option[scala.math.BigDecimal] = None) | ||
56 | /** GetResult implicit for fetching Sale objects using plain SQL queries */ | ||
57 | implicit def GetResultSale(implicit e0: GR[Option[String]], e1: GR[Option[java.sql.Timestamp]], e2: GR[Option[scala.math.BigDecimal]]): GR[Sale] = GR{ | ||
58 | prs => import prs._ | ||
59 | Sale.tupled((<<?[String], <<?[String], <<?[java.sql.Timestamp], <<?[java.sql.Timestamp], <<?[String], <<?[String], <<?[scala.math.BigDecimal], <<?[scala.math.BigDecimal])) | ||
60 | } | ||
61 | /** Table description of table sales. Objects of this class serve as prototypes for rows in queries. */ | ||
62 | class Sales(_tableTag: Tag) extends Table[Sale](_tableTag, "sales") { | ||
63 | def * = (itemUuid, sellerUuid, startDate, endDate, bestBidUuid, bestBidderUuid, bestOffer, charges) <> (Sale.tupled, Sale.unapply) | ||
64 | |||
65 | /** Database column item_uuid DBType(varchar), Length(36,true), Default(None) */ | ||
66 | val itemUuid: Column[Option[String]] = column[Option[String]]("item_uuid", O.Length(36,varying=true), O.Default(None)) | ||
67 | /** Database column seller_uuid DBType(varchar), Length(36,true), Default(None) */ | ||
68 | val sellerUuid: Column[Option[String]] = column[Option[String]]("seller_uuid", O.Length(36,varying=true), O.Default(None)) | ||
69 | /** Database column start_date DBType(timestamptz), Default(None) */ | ||
70 | val startDate: Column[Option[java.sql.Timestamp]] = column[Option[java.sql.Timestamp]]("start_date", O.Default(None)) | ||
71 | /** Database column end_date DBType(timestamptz), Default(None) */ | ||
72 | val endDate: Column[Option[java.sql.Timestamp]] = column[Option[java.sql.Timestamp]]("end_date", O.Default(None)) | ||
73 | /** Database column best_bid_uuid DBType(varchar), Length(36,true), Default(None) */ | ||
74 | val bestBidUuid: Column[Option[String]] = column[Option[String]]("best_bid_uuid", O.Length(36,varying=true), O.Default(None)) | ||
75 | /** Database column best_bidder_uuid DBType(varchar), Length(36,true), Default(None) */ | ||
76 | val bestBidderUuid: Column[Option[String]] = column[Option[String]]("best_bidder_uuid", O.Length(36,varying=true), O.Default(None)) | ||
77 | /** Database column best_offer DBType(numeric), Default(None) */ | ||
78 | val bestOffer: Column[Option[scala.math.BigDecimal]] = column[Option[scala.math.BigDecimal]]("best_offer", O.Default(None)) | ||
79 | /** Database column charges DBType(numeric), Default(None) */ | ||
80 | val charges: Column[Option[scala.math.BigDecimal]] = column[Option[scala.math.BigDecimal]]("charges", O.Default(None)) | ||
81 | } | ||
82 | /** Collection-like TableQuery object for table Sales */ | ||
83 | lazy val Sales = new TableQuery(tag => new Sales(tag)) | ||
84 | } \ No newline at end of file | ||