aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStewart Stewart <stewinsalot@gmail.com>2017-02-21 21:25:19 -0500
committerStewart Stewart <stewinsalot@gmail.com>2017-02-21 21:25:19 -0500
commitaf603a5706bf1ac6b7276f48f9235cdcacbf609f (patch)
treecd3416c04ef272d03f50f667ba02db535a096873 /src
parentd83fd30232aa530bb6722591f86298a87d7fc657 (diff)
downloadslick-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')
-rw-r--r--src/main/scala/NamespacedCodegen.scala17
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])