From cd3230831460027ebcfdce131fff9149c5261ccf Mon Sep 17 00:00:00 2001 From: Daniel K Date: Wed, 11 Oct 2023 11:19:20 +0200 Subject: [PATCH 1/5] #57, #58 function classes commons --- build.sbt | 15 ++++++++++++ .../za/co/absa/ultet/dbitems/DBItem.scala | 2 +- .../ultet/{sqlentry => model}/SQLEntry.scala | 2 +- .../ultet/model/function/FunctionBody.scala | 24 +++++++++++++++++++ .../ultet/model/function/FunctionDrop.scala | 24 +++++++++++++++++++ .../ultet/model/function/FunctionEntry.scala | 22 +++++++++++++++++ .../ultet/model/function/FunctionGrant.scala | 24 +++++++++++++++++++ .../model/function/FunctionOwnership.scala | 24 +++++++++++++++++++ 8 files changed, 135 insertions(+), 2 deletions(-) rename ultet/src/main/scala/za/co/absa/ultet/{sqlentry => model}/SQLEntry.scala (95%) create mode 100644 ultet/src/main/scala/za/co/absa/ultet/model/function/FunctionBody.scala create mode 100644 ultet/src/main/scala/za/co/absa/ultet/model/function/FunctionDrop.scala create mode 100644 ultet/src/main/scala/za/co/absa/ultet/model/function/FunctionEntry.scala create mode 100644 ultet/src/main/scala/za/co/absa/ultet/model/function/FunctionGrant.scala create mode 100644 ultet/src/main/scala/za/co/absa/ultet/model/function/FunctionOwnership.scala diff --git a/build.sbt b/build.sbt index f1b83e62..1dffe63a 100644 --- a/build.sbt +++ b/build.sbt @@ -102,4 +102,19 @@ lazy val faDBExamples = (project in file("examples")) jacocoExcludes := commonJacocoExcludes ) +lazy val ultet = (project in file("ultet")) + .configs(IntegrationTest) + .settings( + name := "examples", + libraryDependencies ++= examplesDependencies(scalaVersion.value), + Test / parallelExecution := false, + (Compile / compile) := ((Compile / compile) dependsOn printScalaVersion).value, // printScalaVersion is run with compile + publish / skip := true + ).dependsOn(faDbCore, faDBSlick) + .settings( + jacocoReportSettings := commonJacocoReportSettings.withTitle(s"fa-db:ultet Jacoco Report - scala:${scalaVersion.value}"), + jacocoExcludes := commonJacocoExcludes + ) + + sonatypeProfileName := "za.co.absa" diff --git a/ultet/src/main/scala/za/co/absa/ultet/dbitems/DBItem.scala b/ultet/src/main/scala/za/co/absa/ultet/dbitems/DBItem.scala index f22faeec..f1270978 100644 --- a/ultet/src/main/scala/za/co/absa/ultet/dbitems/DBItem.scala +++ b/ultet/src/main/scala/za/co/absa/ultet/dbitems/DBItem.scala @@ -16,7 +16,7 @@ package za.co.absa.ultet.dbitems -import za.co.absa.ultet.sqlentry.SQLEntry +import za.co.absa.ultet.model.SQLEntry trait DBItem { def sqlEntry: SQLEntry diff --git a/ultet/src/main/scala/za/co/absa/ultet/sqlentry/SQLEntry.scala b/ultet/src/main/scala/za/co/absa/ultet/model/SQLEntry.scala similarity index 95% rename from ultet/src/main/scala/za/co/absa/ultet/sqlentry/SQLEntry.scala rename to ultet/src/main/scala/za/co/absa/ultet/model/SQLEntry.scala index aa2e819c..3512d321 100644 --- a/ultet/src/main/scala/za/co/absa/ultet/sqlentry/SQLEntry.scala +++ b/ultet/src/main/scala/za/co/absa/ultet/model/SQLEntry.scala @@ -14,7 +14,7 @@ * limitations under the License. */ -package za.co.absa.ultet.sqlentry +package za.co.absa.ultet.model trait SQLEntry { def sqlExpression: String diff --git a/ultet/src/main/scala/za/co/absa/ultet/model/function/FunctionBody.scala b/ultet/src/main/scala/za/co/absa/ultet/model/function/FunctionBody.scala new file mode 100644 index 00000000..c51faba6 --- /dev/null +++ b/ultet/src/main/scala/za/co/absa/ultet/model/function/FunctionBody.scala @@ -0,0 +1,24 @@ +/* + * Copyright 2023 ABSA Group Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package za.co.absa.ultet.model.function + +case class FunctionBody() extends FunctionEntry { + override def sqlExpression: String = ??? + + override def transactionGroup: String = ??? + + override def order: Int = ??? +} diff --git a/ultet/src/main/scala/za/co/absa/ultet/model/function/FunctionDrop.scala b/ultet/src/main/scala/za/co/absa/ultet/model/function/FunctionDrop.scala new file mode 100644 index 00000000..9accaa2d --- /dev/null +++ b/ultet/src/main/scala/za/co/absa/ultet/model/function/FunctionDrop.scala @@ -0,0 +1,24 @@ +/* + * Copyright 2023 ABSA Group Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package za.co.absa.ultet.model.function + +case class FunctionDrop() extends FunctionEntry { + override def sqlExpression: String = ??? + + override def transactionGroup: String = ??? + + override def order: Int = ??? +} diff --git a/ultet/src/main/scala/za/co/absa/ultet/model/function/FunctionEntry.scala b/ultet/src/main/scala/za/co/absa/ultet/model/function/FunctionEntry.scala new file mode 100644 index 00000000..5f70fd47 --- /dev/null +++ b/ultet/src/main/scala/za/co/absa/ultet/model/function/FunctionEntry.scala @@ -0,0 +1,22 @@ +/* + * Copyright 2023 ABSA Group Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package za.co.absa.ultet.model.function + +import za.co.absa.ultet.model.SQLEntry + +trait FunctionEntry extends SQLEntry { + +} diff --git a/ultet/src/main/scala/za/co/absa/ultet/model/function/FunctionGrant.scala b/ultet/src/main/scala/za/co/absa/ultet/model/function/FunctionGrant.scala new file mode 100644 index 00000000..0caf61d2 --- /dev/null +++ b/ultet/src/main/scala/za/co/absa/ultet/model/function/FunctionGrant.scala @@ -0,0 +1,24 @@ +/* + * Copyright 2023 ABSA Group Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package za.co.absa.ultet.model.function + +case class FunctionGrant extends FunctionEntry () { + override def sqlExpression: String = ??? + + override def transactionGroup: String = ??? + + override def order: Int = ??? +} diff --git a/ultet/src/main/scala/za/co/absa/ultet/model/function/FunctionOwnership.scala b/ultet/src/main/scala/za/co/absa/ultet/model/function/FunctionOwnership.scala new file mode 100644 index 00000000..72be2dc2 --- /dev/null +++ b/ultet/src/main/scala/za/co/absa/ultet/model/function/FunctionOwnership.scala @@ -0,0 +1,24 @@ +/* + * Copyright 2023 ABSA Group Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package za.co.absa.ultet.model.function + +case class FunctionOwnership() extends FunctionEntry() { + override def sqlExpression: String = ??? + + override def transactionGroup: String = ??? + + override def order: Int = ??? +} From edc75e4fdb258964f0446140c4c0ec8eb6860291 Mon Sep 17 00:00:00 2001 From: Daniel K Date: Wed, 11 Oct 2023 11:22:25 +0200 Subject: [PATCH 2/5] #57, #58 touchups --- .../scala/za/co/absa/ultet/model/function/FunctionGrant.scala | 2 +- .../za/co/absa/ultet/model/function/FunctionOwnership.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ultet/src/main/scala/za/co/absa/ultet/model/function/FunctionGrant.scala b/ultet/src/main/scala/za/co/absa/ultet/model/function/FunctionGrant.scala index 0caf61d2..dfc80eb9 100644 --- a/ultet/src/main/scala/za/co/absa/ultet/model/function/FunctionGrant.scala +++ b/ultet/src/main/scala/za/co/absa/ultet/model/function/FunctionGrant.scala @@ -15,7 +15,7 @@ */ package za.co.absa.ultet.model.function -case class FunctionGrant extends FunctionEntry () { +case class FunctionGrant() extends FunctionEntry () { override def sqlExpression: String = ??? override def transactionGroup: String = ??? diff --git a/ultet/src/main/scala/za/co/absa/ultet/model/function/FunctionOwnership.scala b/ultet/src/main/scala/za/co/absa/ultet/model/function/FunctionOwnership.scala index 72be2dc2..1de8a5d4 100644 --- a/ultet/src/main/scala/za/co/absa/ultet/model/function/FunctionOwnership.scala +++ b/ultet/src/main/scala/za/co/absa/ultet/model/function/FunctionOwnership.scala @@ -15,7 +15,7 @@ */ package za.co.absa.ultet.model.function -case class FunctionOwnership() extends FunctionEntry() { +case class FunctionOwnership() extends FunctionEntry { override def sqlExpression: String = ??? override def transactionGroup: String = ??? From cd08f8274c367a0fbf47e8a80cde1aec407f7e53 Mon Sep 17 00:00:00 2001 From: Daniel K Date: Wed, 11 Oct 2023 11:27:03 +0200 Subject: [PATCH 3/5] #57, #58 removing the ultet module from root `build.sbt` --- build.sbt | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/build.sbt b/build.sbt index 1dffe63a..f1b83e62 100644 --- a/build.sbt +++ b/build.sbt @@ -102,19 +102,4 @@ lazy val faDBExamples = (project in file("examples")) jacocoExcludes := commonJacocoExcludes ) -lazy val ultet = (project in file("ultet")) - .configs(IntegrationTest) - .settings( - name := "examples", - libraryDependencies ++= examplesDependencies(scalaVersion.value), - Test / parallelExecution := false, - (Compile / compile) := ((Compile / compile) dependsOn printScalaVersion).value, // printScalaVersion is run with compile - publish / skip := true - ).dependsOn(faDbCore, faDBSlick) - .settings( - jacocoReportSettings := commonJacocoReportSettings.withTitle(s"fa-db:ultet Jacoco Report - scala:${scalaVersion.value}"), - jacocoExcludes := commonJacocoExcludes - ) - - sonatypeProfileName := "za.co.absa" From 3dd09747e6c7346ef14344a175fe0a7bb2889efe Mon Sep 17 00:00:00 2001 From: Daniel K Date: Wed, 11 Oct 2023 11:28:38 +0200 Subject: [PATCH 4/5] #57, #58 () fix --- .../scala/za/co/absa/ultet/model/function/FunctionGrant.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ultet/src/main/scala/za/co/absa/ultet/model/function/FunctionGrant.scala b/ultet/src/main/scala/za/co/absa/ultet/model/function/FunctionGrant.scala index dfc80eb9..fe2107a6 100644 --- a/ultet/src/main/scala/za/co/absa/ultet/model/function/FunctionGrant.scala +++ b/ultet/src/main/scala/za/co/absa/ultet/model/function/FunctionGrant.scala @@ -15,7 +15,7 @@ */ package za.co.absa.ultet.model.function -case class FunctionGrant() extends FunctionEntry () { +case class FunctionGrant() extends FunctionEntry { override def sqlExpression: String = ??? override def transactionGroup: String = ??? From 212d45681b02782e5e4e44bc653ce8fa1f42f52c Mon Sep 17 00:00:00 2001 From: Daniel K Date: Wed, 11 Oct 2023 11:45:16 +0200 Subject: [PATCH 5/5] #57,58 DBItem.sqlEntry is now of type Seq[SQLEntry] --- ultet/src/main/scala/za/co/absa/ultet/dbitems/DBItem.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ultet/src/main/scala/za/co/absa/ultet/dbitems/DBItem.scala b/ultet/src/main/scala/za/co/absa/ultet/dbitems/DBItem.scala index f1270978..6bdbf24c 100644 --- a/ultet/src/main/scala/za/co/absa/ultet/dbitems/DBItem.scala +++ b/ultet/src/main/scala/za/co/absa/ultet/dbitems/DBItem.scala @@ -19,5 +19,5 @@ package za.co.absa.ultet.dbitems import za.co.absa.ultet.model.SQLEntry trait DBItem { - def sqlEntry: SQLEntry + def sqlEntry: Seq[SQLEntry] }