diff options
author | Stewart Stewart <stewinsalot@gmail.com> | 2017-02-24 07:46:40 -0500 |
---|---|---|
committer | Stewart Stewart <stewinsalot@gmail.com> | 2017-02-24 07:49:03 -0500 |
commit | 8be11dc3a5920d7a97831c688c06999dd09bfd1b (patch) | |
tree | ab80f410fc28cb9e1aae21552ad05849e4b02445 /src/main/scala/NamespacedCodegen.scala | |
parent | 2e96fdd23a18cd12ea6705f1e04b4824ca479dbc (diff) | |
download | slick-codegen-plugin-8be11dc3a5920d7a97831c688c06999dd09bfd1b.tar.gz slick-codegen-plugin-8be11dc3a5920d7a97831c688c06999dd09bfd1b.tar.bz2 slick-codegen-plugin-8be11dc3a5920d7a97831c688c06999dd09bfd1b.zip |
use typed id columns in row generators and remove old implementation
Diffstat (limited to 'src/main/scala/NamespacedCodegen.scala')
-rw-r--r-- | src/main/scala/NamespacedCodegen.scala | 58 |
1 files changed, 4 insertions, 54 deletions
diff --git a/src/main/scala/NamespacedCodegen.scala b/src/main/scala/NamespacedCodegen.scala index ea6fcdf..16ab383 100644 --- a/src/main/scala/NamespacedCodegen.scala +++ b/src/main/scala/NamespacedCodegen.scala @@ -57,7 +57,10 @@ object Generator { schemaOnlyModel, headerComment = header, imports = schemaImports.map("import " + _).mkString("\n"), - schemaName = schemaName + schemaName = schemaName, + dbModel, + idType, + manualForeignKeys ) /* val tableGenerator: TableFileGenerator = ??? @@ -237,59 +240,6 @@ object SchemaParser { } } -class RowGenerator(pkg: String, - fullDatabaseModel: Model, - schemaOnlyModel: Model, - manualForeignKeys: Map[(String, String), (String, String)], - override val parentType: Option[String], - idType: Option[String], - override val headerComment: String, - schemaImports: List[String], - typeReplacements: Map[String, String]) - extends Generator(pkg, - fullDatabaseModel, - schemaOnlyModel, - manualForeignKeys, - parentType, - idType, - headerComment, - schemaImports, - typeReplacements) { - - override def Table = new TableO(_) { - //override def Column = new IdColumn(_){ } - override def code = Seq[Def](EntityType).map(_.docWithCode) - } - - override def code = tables.map(_.code.mkString("\n")).mkString("\n\n") - - def writeToFile(schemaName: String, - folder: String, - pkg: String, - fileName: String) = { - writeStringToFile(packageCode(pkg, schemaName), - folder = folder, - pkg = pkg, - fileName = fileName) - } - - override val imports = schemaImports.map("import " + _).mkString("\n") - - def packageCode(pkg: String, schemaName: String) = { - s"""|package $pkg - |package $schemaName - | - |$imports - | - |$code - |""".stripMargin.trim() - } - - // disable helpers for Table schema generators - //override def packageCode(profile: String, pkg: String, container: String, parentType: Option[String]) = ??? - //override def writeToFile(profile: String, folder: String, pkg: String, container: String, fileName: String) = ??? -} - class TableGenerator( pkg: String, fullDatabaseModel: Model, |