diff options
author | Stewart Stewart <stewinsalot@gmail.com> | 2017-02-21 21:25:19 -0500 |
---|---|---|
committer | Stewart Stewart <stewinsalot@gmail.com> | 2017-02-21 21:25:19 -0500 |
commit | af603a5706bf1ac6b7276f48f9235cdcacbf609f (patch) | |
tree | cd3416c04ef272d03f50f667ba02db535a096873 /src/main/scala | |
parent | d83fd30232aa530bb6722591f86298a87d7fc657 (diff) | |
download | slick-codegen-plugin-af603a5706bf1ac6b7276f48f9235cdcacbf609f.tar.gz slick-codegen-plugin-af603a5706bf1ac6b7276f48f9235cdcacbf609f.tar.bz2 slick-codegen-plugin-af603a5706bf1ac6b7276f48f9235cdcacbf609f.zip |
override parentType and use writeToFile
Diffstat (limited to 'src/main/scala')
-rw-r--r-- | src/main/scala/NamespacedCodegen.scala | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/main/scala/NamespacedCodegen.scala b/src/main/scala/NamespacedCodegen.scala index 36dd03a..52761b9 100644 --- a/src/main/scala/NamespacedCodegen.scala +++ b/src/main/scala/NamespacedCodegen.scala @@ -53,19 +53,15 @@ object Generator { dbModel, schemaOnlyModel, manualForeignKeys, + parentType, idType, schemaImports, typeReplacements) - generator.writeStringToFile( - content = generator.packageCode(profile = profile, - pkg = pkg, - container = schemaName, - parentType = parentType), - folder = outputPath, - pkg = pkg, - fileName = s"${schemaName}.scala") - // TODO: Use generator.writeToFile, after figuring out `parentType` - // parentType in scope used here is defaulted to None and needs to be overriden + generator.writeToFile(profile = profile, + folder = outputPath, + pkg = pkg, + container = schemaName, + fileName = s"${schemaName}.scala") } } finally { dc.db.close() @@ -84,6 +80,7 @@ class Generator(pkg: String, fullDatabaseModel: Model, schemaOnlyModel: Model, manualForeignKeys: Map[(String, String), (String, String)], + override val parentType: Option[String], idType: Option[String], schemaImports: List[String], typeReplacements: Map[String, String]) |