From 148926ca0358a9278c6e2b572c224df33b1f7902 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Fern=C3=A1ndez?= Date: Tue, 24 Dec 2024 13:26:18 +0100 Subject: [PATCH 1/7] build --- project/Build.scala | 62 ++++++++++++++++++++++++++++++----- project/SonatypePublish.scala | 43 ++++++++++++++++++++++++ project/plugins.sbt | 11 ++++--- publish.sbt | 40 ---------------------- 4 files changed, 103 insertions(+), 53 deletions(-) create mode 100644 project/SonatypePublish.scala delete mode 100644 publish.sbt diff --git a/project/Build.scala b/project/Build.scala index 68c4864..753ee4c 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -1,12 +1,14 @@ -import sbt.* -import sbt.Keys.* +import de.heikoseeberger.sbtheader.HeaderPlugin.autoImport.{HeaderLicense, headerLicense} +import de.heikoseeberger.sbtheader.{HeaderPlugin, License} +import sbt.Keys._ +import sbt._ import sbt.plugins.JvmPlugin -import sbtassembly.AssemblyKeys.* +import sbtassembly.AssemblyKeys._ import sbtassembly.{MergeStrategy, PathList} object Build extends AutoPlugin { - override def requires: Plugins = JvmPlugin + override def requires: Plugins = JvmPlugin && HeaderPlugin override def trigger: PluginTrigger = allRequirements @@ -17,22 +19,33 @@ object Build extends AutoPlugin { ) lazy val localJvmSettings: Seq[String] = - Seq("-Xms384M", "-Xmx384M", "-XX:MaxMetaspaceSize=150M", "-XX:+PrintCommandLineFlags") + Seq( + "-Xms384M", + "-Xmx384M", + "-XX:MaxMetaspaceSize=150M", + "-XX:+PrintCommandLineFlags", + "-XX:+CMSClassUnloadingEnabled", + "-Duser.timezone=GMT", + "-XX:+PrintCommandLineFlags", + "-XX:+CMSClassUnloadingEnabled" + ) override def projectSettings: Seq[Setting[_]] = Vector( - ThisBuild / organization := "io.github.rafafrdz", - ThisBuild / name := "criteria-dsl", + ThisBuild / organizationName := "eff3ct", + ThisBuild / organization := "com.eff3ct", ThisBuild / scalaVersion := Version.Scala, ThisBuild / crossScalaVersions := Vector(scalaVersion.value), ThisBuild / javacOptions := Seq("-g:none"), ThisBuild / run / javaOptions ++= localJvmSettings, ThisBuild / run / fork := true, ThisBuild / Test / fork := true, + headerLicense := Some(headerIOLicense), ThisBuild / scalacOptions ++= Vector( - "-target:jvm-1.8", + "-release:8", "-deprecation", // Emit warning and location for usages of deprecated APIs. "-encoding", + "-Ymacro-annotations", "utf-8", // Specify character encoding used by source files. "-explaintypes", // Explain type errors in more detail. "-feature", // Emit warning and location for usages of features that should be imported explicitly. @@ -98,7 +111,7 @@ object Build extends AutoPlugin { // -v Log "test run started" / "test started" / "test run finished" events on log level "info" instead of "debug" // -a Show stack traces and exception class name for AssertionErrors ThisBuild / Test / testOptions += Tests.Argument(TestFrameworks.JUnit, "-v", "-a") - ) + ) ++ SonatypePublish.projectSettings lazy val assemblySettings = Seq( assembly / assemblyMergeStrategy := { @@ -109,4 +122,35 @@ object Build extends AutoPlugin { }, assembly / assemblyJarName := s"${name.value}-${version.value}.jar" ) + + /** + * SBT Header Plugin + */ + + lazy val headerText: String = + """|MIT License + | + |Copyright (c) 2024 Rafael Fernandez + | + |Permission is hereby granted, free of charge, to any person obtaining a copy + |of this software and associated documentation files (the "Software"), to deal + |in the Software without restriction, including without limitation the rights + |to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + |copies of the Software, and to permit persons to whom the Software is + |furnished to do so, subject to the following conditions: + | + |The above copyright notice and this permission notice shall be included in all + |copies or substantial portions of the Software. + | + |THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + |IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + |FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + |AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + |LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + |OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + |SOFTWARE. + |""".stripMargin + + lazy val headerIOLicense: License.Custom = + HeaderLicense.Custom(headerText) } diff --git a/project/SonatypePublish.scala b/project/SonatypePublish.scala new file mode 100644 index 0000000..8a85eaf --- /dev/null +++ b/project/SonatypePublish.scala @@ -0,0 +1,43 @@ +import sbt.Keys._ +import sbt.{url, _} +import xerial.sbt.Sonatype._ +import xerial.sbt.Sonatype.autoImport._ + +import scala.collection.Seq + +object SonatypePublish { + + def projectSettings: Seq[Setting[_]] = Seq( + ThisBuild / publish / skip := true, + ThisBuild / versionScheme := Some("early-semver"), + ThisBuild / sonatypeCredentialHost := sonatypeCentralHost, + ThisBuild / organization := "com.eff3ct", + ThisBuild / organizationName := "eff3ct", + ThisBuild / organizationHomepage := Some(url("https://github.com/ef3ct")), + ThisBuild / homepage := Some(url("https://github.com/ef3ct/criteria4s")), + ThisBuild / licenses := Seq("MIT" -> url("https://opensource.org/licenses/MIT")), + ThisBuild / description := "A simple DSL to create criterias for filtering data in Scala.", + ThisBuild / scmInfo := Some( + ScmInfo( + browseUrl = url("https://github.com/ef3ct/criteria4s"), + connection = "scm:git@github.com:ef3ct/criteria4s.git" + ) + ), + ThisBuild / developers := List( + Developer( + id = "rafafrdz", + name = "Rafael Fernandez", + email = "hi@rafaelfernandez.dev", + url = url("https://rafaelfernandez.dev") + ) + ), + ThisBuild / sonatypeProjectHosting := Some( + GitHubHosting( + user = "ef3ct", + repository = "criteria4s", + email = "hi@rafaelfernandez.dev" + ) + ) + ) + +} diff --git a/project/plugins.sbt b/project/plugins.sbt index 768d9c1..0bffe24 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,4 +1,7 @@ -addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.9.15") -addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12") -addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.0") -addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.15.0") +/** Build */ +addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "2.3.0") +addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2") +addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.10.0") + +/** Publish */ +addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.9.2") \ No newline at end of file diff --git a/publish.sbt b/publish.sbt deleted file mode 100644 index 9735475..0000000 --- a/publish.sbt +++ /dev/null @@ -1,40 +0,0 @@ -import xerial.sbt.Sonatype.* - -ThisBuild / organization := "io.github.rafafrdz" -ThisBuild / organizationName := "rafafrdz" -ThisBuild / sonatypeProfileName := "io.github.rafafrdz" -ThisBuild / organizationHomepage := Some(url("https://github.com/rafafrdz")) -ThisBuild / homepage := Some(url("https://github.com/rafafrdz/criteria4s")) - -ThisBuild / scmInfo := Some( - ScmInfo( - url("https://github.com/rafafrdz/criteria4s"), - "scm:git@github.com:rafafrdz/criteria4s.git" - ) -) - -ThisBuild / developers := List( - Developer( - id = "rafafrdz", - name = "Rafael Fernández Ortiz", - email = "criteria4s@rafaelfernandez.dev", - url = url("https://github.com/rafafrdz") - ) -) -ThisBuild / description := "A simple DSL to create criterias for filtering data in Scala." -ThisBuild / licenses := List("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0.txt")) -ThisBuild / publish / skip := true -ThisBuild / versionScheme := Some("early-semver") -ThisBuild / pomIncludeRepository := { _ => false } - -/** Reference the project OSS repository */ -// Repository for releases on Maven Central using Sonatype -ThisBuild / sonatypeCredentialHost := "s01.oss.sonatype.org" -ThisBuild / sonatypeRepository := "https://s01.oss.sonatype.org/service/local" -ThisBuild / sonatypeProjectHosting := Some( - GitHubHosting( - user = "rafafrdz", - repository = "criteria4s", - email = "criteria4s@rafaelfernandez.dev" - ) -) From a4f95ef2e4de7185feddd75363ded7078439ba91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Fern=C3=A1ndez?= Date: Tue, 24 Dec 2024 13:27:17 +0100 Subject: [PATCH 2/7] build --- build.sbt | 2 +- project/NoPublish.scala | 14 -------------- 2 files changed, 1 insertion(+), 15 deletions(-) delete mode 100644 project/NoPublish.scala diff --git a/build.sbt b/build.sbt index c00d67a..30cbb0e 100644 --- a/build.sbt +++ b/build.sbt @@ -3,7 +3,7 @@ import Dependencies.ProjectOps lazy val criteria4s: Project = project .in(file(".")) - .disablePlugins(AssemblyPlugin) + .disablePlugins(Build, AssemblyPlugin, HeaderPlugin) .aggregate(core, sql, mongodb, examples) .settings( name := "criteria4s" diff --git a/project/NoPublish.scala b/project/NoPublish.scala deleted file mode 100644 index ac24c7a..0000000 --- a/project/NoPublish.scala +++ /dev/null @@ -1,14 +0,0 @@ -import sbt._ -import sbt.Keys._ -import sbt.plugins.JvmPlugin - -object NoPublish extends AutoPlugin { - - override def requires: JvmPlugin.type = plugins.JvmPlugin - - override def projectSettings = Seq( - publishArtifact := false, - publish := {}, - publishLocal := {} - ) -} \ No newline at end of file From bdfbb74cd9fd29ba710e3b7e4b6ad45955428d36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Fern=C3=A1ndez?= Date: Tue, 24 Dec 2024 13:29:28 +0100 Subject: [PATCH 3/7] cicd wf --- .github/release-drafter.yml | 8 ++++--- .github/workflows/ci.yml | 39 ++++++++++++++++++++++++++++++++++ .github/workflows/releases.yml | 21 +++++++----------- .github/workflows/scala-ci.yml | 27 ----------------------- 4 files changed, 52 insertions(+), 43 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/scala-ci.yml diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index de48a5a..ea629cd 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -4,6 +4,7 @@ categories: - title: '🔥 Breaking Changes' labels: - 'breaking' + - 'break' - title: '🚀 Features' labels: - 'feature' @@ -37,6 +38,10 @@ template: | **Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION autolabeler: + - label: 'feature' + title: + - '/feature/i' + - '/feat/i' - label: 'documentation' files: - '*.md' @@ -56,6 +61,3 @@ autolabeler: - label: 'deprecation' title: - '/deprecate/i' - - label: 'feature' - title: - - '/feature/i' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..b26b9fc --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,39 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: Scala CI +on: + pull_request: + push: + branches: [ "master" ] +jobs: + build: + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-latest + java: 8 + - os: ubuntu-latest + java: 11 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: ${{ matrix.java }} + + - uses: sbt/setup-sbt@v1 + + - name: Create header and run scalafmt + run: sbt headerCreateAll scalafmtAll + + - name: Build and Test + run: sbt -v +test + + # Optional: This step uploads information to the GitHub dependency graph and unblocking Dependabot alerts for the repository + #- name: Upload dependency graph + # uses: scalacenter/sbt-dependency-submission@ab086b50c947c9774b70f39fc7f6e20ca2706c91 diff --git a/.github/workflows/releases.yml b/.github/workflows/releases.yml index dbbae59..6dc9eaa 100644 --- a/.github/workflows/releases.yml +++ b/.github/workflows/releases.yml @@ -1,29 +1,24 @@ name: Release on: push: - tags: - - v* + branches: [master, main] + tags: ["*"] jobs: publish: runs-on: ubuntu-latest steps: - - - name: Checkout - uses: actions/checkout@v4 + - uses: actions/checkout@v4 with: fetch-depth: 0 - - - name: Set up JDK - uses: actions/setup-java@v4 + - uses: actions/setup-java@v4 with: distribution: temurin - java-version: 8 + java-version: 11 cache: sbt - - - name: Release - run: sbt ci-release + - uses: sbt/setup-sbt@v1 + - run: sbt ci-release env: PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} PGP_SECRET: ${{ secrets.PGP_SECRET }} - SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} + SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} diff --git a/.github/workflows/scala-ci.yml b/.github/workflows/scala-ci.yml deleted file mode 100644 index 517f88a..0000000 --- a/.github/workflows/scala-ci.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Scala CI -on: - pull_request: - branches: [ "master" ] - -jobs: - checks: - runs-on: ubuntu-latest - steps: - - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Set up JDK - uses: actions/setup-java@v4 - with: - distribution: temurin - java-version: 8 - cache: sbt - - - name: Check scalafmt - run: sbt scalafmtCheckAll - - - name: Check build - run: sbt clean compile test doc \ No newline at end of file From 7230dcf67d6365e5181c18c279a2161de49b500d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Fern=C3=A1ndez?= Date: Tue, 24 Dec 2024 13:31:51 +0100 Subject: [PATCH 4/7] doc --- .scalafmt.conf | 5 +- CODE_OF_CONDUCT.md | 14 +++ CONTRIBUTING.md | 66 ++++++++++++++ LICENSE | 222 +++++---------------------------------------- 4 files changed, 105 insertions(+), 202 deletions(-) create mode 100644 CODE_OF_CONDUCT.md create mode 100644 CONTRIBUTING.md diff --git a/.scalafmt.conf b/.scalafmt.conf index 78e9bb6..a78cf64 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -21,4 +21,7 @@ docstrings.style = Asterisk rewrite { rules = [SortImports, RedundantBraces] redundantBraces.maxLines = 1 -} \ No newline at end of file +} + +docstrings.wrap = no +importSelectors = singleLine diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..e806fa2 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,14 @@ +# Code of Conduct + +Every member of our community has the right to have their identity respected. The Typelevel community is dedicated to providing a positive experience for everyone, regardless of age, gender identity and expression, sexual orientation, disability, neurodivergence, physical appearance, body size, ethnicity, nationality, race, or religion (or lack thereof), education, or socio-economic status. + +Everyone is expected to follow the [Typelevel Code of Conduct] when discussing the project on the available communication channels. + +## Moderation + +If you have any questions, concerns, or moderation requests, please contact a member of the [Typelevel Code of Conduct Committee] or reach out to a project moderator: + +- [Rafael Fernandez](mailto:hi@rafaelfernandez.dev) + +[Typelevel Code of Conduct]: https://typelevel.org/code-of-conduct +[Typelevel Code of Conduct Committee]: https://typelevel.org/code-of-conduct#contact diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..f7e6399 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,66 @@ +# Contributing to Criteria4s + +Thank you for considering contributing to Criteria4s! We welcome contributions from the community to improve this project. Below are some guidelines to help you get started. + +## Code of Conduct + +Please adhere to our [Code of Conduct](CODE_OF_CONDUCT.md) during your interactions in the project repository. We strive to provide a welcoming and inclusive environment for all contributors. + +## How to Contribute + +### 1. Fork the Repository + +Fork the repository on GitHub by clicking the "Fork" button at the top right of the page. + +### 2. Clone Your Fork + +Clone your fork to your local machine: + +```sh +git clone https://github.com/your-username/criteria4s.git +cd criteria4s +``` + +### 3. Create a Branch + +Create a branch for your feature or bug fix: + +```sh +git checkout -b my-feature-branch +``` + +### 4. Make Changes + +Make your changes to the code. Ensure your code adheres to the project's coding standards. + +### 5. Commit Your Changes + +Commit your changes with a descriptive commit message: + +```sh +git commit -m "Add feature X" +``` + +### 6. Push to Your Fork + +Push your changes to your fork on GitHub: + +```sh +git push origin my-feature-branch +``` + +### 7. Open a Pull Request + +Go to the original repository and open a pull request. Provide a clear and descriptive title and description of your changes. + +## Code of Conduct + +Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. + +## Reporting Issues + +If you find a bug or have a feature request, please create an issue on GitHub. Provide as much detail as possible to help us address it. + +## Thank You! + +Thank you for contributing to Criteria4s! Your help is greatly appreciated. \ No newline at end of file diff --git a/LICENSE b/LICENSE index c319da3..772ba7c 100644 --- a/LICENSE +++ b/LICENSE @@ -1,201 +1,21 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - -Copyright [yyyy] [name of copyright owner] - -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. +MIT License + +Copyright (c) 2024 Rafael Fernandez + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From ad740a3a481f0830a733770cb5bf3f90555d5e22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Fern=C3=A1ndez?= Date: Tue, 24 Dec 2024 13:36:05 +0100 Subject: [PATCH 5/7] rename package --- README.md | 28 +++++++++---------- .../eff3ct}/criteria4s/core/Conjuction.scala | 8 +++--- .../eff3ct}/criteria4s/core/Criteria.scala | 2 +- .../eff3ct}/criteria4s/core/Predicate.scala | 6 ++-- .../eff3ct}/criteria4s/core/Ref.scala | 2 +- .../eff3ct}/criteria4s/core/Show.scala | 2 +- .../eff3ct}/criteria4s/core/package.scala | 2 +- .../criteria4s/extensions/conjunctions.scala | 6 ++-- .../criteria4s/extensions/package.scala | 2 +- .../criteria4s/extensions/predicates.scala | 12 ++++---- .../criteria4s/functions/conjunctions.scala | 4 +-- .../criteria4s/functions/package.scala | 4 +-- .../criteria4s/functions/predicates.scala | 10 +++---- .../instances/builder/BuilderBinary.scala | 4 +-- .../instances/builder/BuilderUnary.scala | 7 +++++ .../criteria4s/instances/package.scala | 6 ++-- .../instances/builder/BuilderUnary.scala | 7 ----- .../criteria4s/examples/ArraysExample.scala | 10 +++---- .../criteria4s/examples/BetweenExample.scala | 12 ++++---- .../eff3ct}/criteria4s/examples/Example.scala | 8 +++--- .../criteria4s/examples/Example2.scala | 10 +++---- .../criteria4s/examples/Example3.scala | 10 +++---- .../criteria4s/examples/Example4.scala | 12 ++++---- .../examples/FilterByUserExample.scala | 12 ++++---- .../criteria4s/examples/NotExample.scala | 12 ++++---- .../examples/datastores/MySQL.scala | 10 +++---- .../examples/datastores/Postgres.scala | 6 ++-- .../examples/datastores/WeirdDatastore.scala | 6 ++-- .../criteria4s/dialect/mongodb/MongoDB.scala | 6 ++-- .../criteria4s/dialect/mongodb/package.scala | 2 +- .../eff3ct}/criteria4s/dialect/sql/SQL.scala | 6 ++-- .../criteria4s/dialect/sql/package.scala | 2 +- 32 files changed, 118 insertions(+), 118 deletions(-) rename core/src/main/scala/{io/github/rafafrdz => com/eff3ct}/criteria4s/core/Conjuction.scala (86%) rename core/src/main/scala/{io/github/rafafrdz => com/eff3ct}/criteria4s/core/Criteria.scala (86%) rename core/src/main/scala/{io/github/rafafrdz => com/eff3ct}/criteria4s/core/Predicate.scala (97%) rename core/src/main/scala/{io/github/rafafrdz => com/eff3ct}/criteria4s/core/Ref.scala (96%) rename core/src/main/scala/{io/github/rafafrdz => com/eff3ct}/criteria4s/core/Show.scala (88%) rename core/src/main/scala/{io/github/rafafrdz => com/eff3ct}/criteria4s/core/package.scala (96%) rename core/src/main/scala/{io/github/rafafrdz => com/eff3ct}/criteria4s/extensions/conjunctions.scala (76%) rename core/src/main/scala/{io/github/rafafrdz => com/eff3ct}/criteria4s/extensions/package.scala (62%) rename core/src/main/scala/{io/github/rafafrdz => com/eff3ct}/criteria4s/extensions/predicates.scala (84%) rename core/src/main/scala/{io/github/rafafrdz => com/eff3ct}/criteria4s/functions/conjunctions.scala (88%) rename core/src/main/scala/{io/github/rafafrdz => com/eff3ct}/criteria4s/functions/package.scala (89%) rename core/src/main/scala/{io/github/rafafrdz => com/eff3ct}/criteria4s/functions/predicates.scala (91%) rename core/src/main/scala/{io/github/rafafrdz => com/eff3ct}/criteria4s/instances/builder/BuilderBinary.scala (50%) create mode 100644 core/src/main/scala/com/eff3ct/criteria4s/instances/builder/BuilderUnary.scala rename core/src/main/scala/{io/github/rafafrdz => com/eff3ct}/criteria4s/instances/package.scala (63%) delete mode 100644 core/src/main/scala/io/github/rafafrdz/criteria4s/instances/builder/BuilderUnary.scala rename examples/src/main/scala/{io/github/rafafrdz => com/eff3ct}/criteria4s/examples/ArraysExample.scala (75%) rename examples/src/main/scala/{io/github/rafafrdz => com/eff3ct}/criteria4s/examples/BetweenExample.scala (63%) rename examples/src/main/scala/{io/github/rafafrdz => com/eff3ct}/criteria4s/examples/Example.scala (63%) rename examples/src/main/scala/{io/github/rafafrdz => com/eff3ct}/criteria4s/examples/Example2.scala (75%) rename examples/src/main/scala/{io/github/rafafrdz => com/eff3ct}/criteria4s/examples/Example3.scala (77%) rename examples/src/main/scala/{io/github/rafafrdz => com/eff3ct}/criteria4s/examples/Example4.scala (78%) rename examples/src/main/scala/{io/github/rafafrdz => com/eff3ct}/criteria4s/examples/FilterByUserExample.scala (69%) rename examples/src/main/scala/{io/github/rafafrdz => com/eff3ct}/criteria4s/examples/NotExample.scala (79%) rename examples/src/main/scala/{io/github/rafafrdz => com/eff3ct}/criteria4s/examples/datastores/MySQL.scala (56%) rename examples/src/main/scala/{io/github/rafafrdz => com/eff3ct}/criteria4s/examples/datastores/Postgres.scala (77%) rename examples/src/main/scala/{io/github/rafafrdz => com/eff3ct}/criteria4s/examples/datastores/WeirdDatastore.scala (93%) rename mongodb/src/main/scala/{io/github/rafafrdz => com/eff3ct}/criteria4s/dialect/mongodb/MongoDB.scala (94%) rename mongodb/src/main/scala/{io/github/rafafrdz => com/eff3ct}/criteria4s/dialect/mongodb/package.scala (72%) rename sql/src/main/scala/{io/github/rafafrdz => com/eff3ct}/criteria4s/dialect/sql/SQL.scala (94%) rename sql/src/main/scala/{io/github/rafafrdz => com/eff3ct}/criteria4s/dialect/sql/package.scala (66%) diff --git a/README.md b/README.md index 93fdf69..7453306 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -![Sonatype Nexus (Releases)](https://img.shields.io/nexus/r/io.github.rafafrdz/criteria4s-core_2.13?server=https%3A%2F%2Fs01.oss.sonatype.org&style=flat-square&label=Sonatype&labelColor=%20&color=%2acf45%20%20) [![License](https://img.shields.io/badge/license-Apache%202-blue.svg?style=flat-square&label=License)](https://github.com/rafafrdz/criteria4s?tab=Apache-2.0-1-ov-file#readme) +![Sonatype Nexus (Releases)](https://img.shields.io/nexus/r/com.eff3ct/criteria4s-core_2.13?server=https%3A%2F%2Fs01.oss.sonatype.org&style=flat-square&label=Sonatype&labelColor=%20&color=%2acf45%20%20) [![License](https://img.shields.io/badge/license-Apache%202-blue.svg?style=flat-square&label=License)](https://github.com/rafafrdz/criteria4s?tab=Apache-2.0-1-ov-file#readme) # Criteria4s @@ -35,17 +35,17 @@ To use dsl of Criteria4s, you need to add the following dependency to your proje **SonaType Repository** -- Core library: [criteria4s-core](https://central.sonatype.com/artifact/io.github.rafafrdz/criteria4s-core_2.13) -- SQL implementation: [criteria4s-sql](https://central.sonatype.com/artifact/io.github.rafafrdz/criteria4s-sql_2.13) +- Core library: [criteria4s-core](https://central.sonatype.com/artifact/com.eff3ct/criteria4s-core_2.13) +- SQL implementation: [criteria4s-sql](https://central.sonatype.com/artifact/com.eff3ct/criteria4s-sql_2.13) - MongoDB dialect - implementation: [criteria4s-mongodb](https://central.sonatype.com/artifact/io.github.rafafrdz/criteria4s-mongodb_2.13) + implementation: [criteria4s-mongodb](https://central.sonatype.com/artifact/com.eff3ct/criteria4s-mongodb_2.13) **SBT** ```scala -libraryDependencies += "io.github.rafafrdz" %% "criteria4s-core" % "" // Core library -libraryDependencies += "io.github.rafafrdz" %% "criteria4s-sql" % "" // SQL implementation -libraryDependencies += "io.github.rafafrdz" %% "criteria4s-mongodb" % "" // MongoDB implementation +libraryDependencies += "com.eff3ct" %% "criteria4s-core" % "" // Core library +libraryDependencies += "com.eff3ct" %% "criteria4s-sql" % "" // SQL implementation +libraryDependencies += "com.eff3ct" %% "criteria4s-mongodb" % "" // MongoDB implementation ``` @@ -55,21 +55,21 @@ libraryDependencies += "io.github.rafafrdz" %% "criteria4s-mongodb" % " - io.github.rafafrdz + com.eff3ct criteria4s-core_2.13 0.8.2 - io.github.rafafrdz + com.eff3ct criteria4s-core_2.13 0.8.2 - io.github.rafafrdz + com.eff3ct criteria4s-mongodb_2.13 0.8.2 @@ -99,10 +99,10 @@ the [`criteria4s-examples`](./examples/src/main/scala/io/github/rafafrdz/criteri First, we need to import the Criteria4s DSL and the SQL dialect: ```scala -import io.github.rafafrdz.criteria4s.core._ -import io.github.rafafrdz.criteria4s.examples.datastores._ -import io.github.rafafrdz.criteria4s.extensions._ -import io.github.rafafrdz.criteria4s.functions._ +import com.eff3ct.criteria4s.core._ +import com.eff3ct.criteria4s.examples.datastores._ +import com.eff3ct.criteria4s.extensions._ +import com.eff3ct.criteria4s.functions._ ``` ### Defining Criteria Expressions diff --git a/core/src/main/scala/io/github/rafafrdz/criteria4s/core/Conjuction.scala b/core/src/main/scala/com/eff3ct/criteria4s/core/Conjuction.scala similarity index 86% rename from core/src/main/scala/io/github/rafafrdz/criteria4s/core/Conjuction.scala rename to core/src/main/scala/com/eff3ct/criteria4s/core/Conjuction.scala index dc70ae7..ea37979 100644 --- a/core/src/main/scala/io/github/rafafrdz/criteria4s/core/Conjuction.scala +++ b/core/src/main/scala/com/eff3ct/criteria4s/core/Conjuction.scala @@ -1,8 +1,8 @@ -package io.github.rafafrdz.criteria4s.core +package com.eff3ct.criteria4s.core -import io.github.rafafrdz.criteria4s.core -import io.github.rafafrdz.criteria4s.core.Criteria._ -import io.github.rafafrdz.criteria4s.instances.builder._ +import com.eff3ct.criteria4s.core +import com.eff3ct.criteria4s.core.Criteria._ +import com.eff3ct.criteria4s.instances.builder._ trait ConjuctionBinary[T <: CriteriaTag] { def eval(cr1: Criteria[T], cr2: Criteria[T]): Criteria[T] diff --git a/core/src/main/scala/io/github/rafafrdz/criteria4s/core/Criteria.scala b/core/src/main/scala/com/eff3ct/criteria4s/core/Criteria.scala similarity index 86% rename from core/src/main/scala/io/github/rafafrdz/criteria4s/core/Criteria.scala rename to core/src/main/scala/com/eff3ct/criteria4s/core/Criteria.scala index 272d1df..0495743 100644 --- a/core/src/main/scala/io/github/rafafrdz/criteria4s/core/Criteria.scala +++ b/core/src/main/scala/com/eff3ct/criteria4s/core/Criteria.scala @@ -1,4 +1,4 @@ -package io.github.rafafrdz.criteria4s.core +package com.eff3ct.criteria4s.core trait Criteria[T <: CriteriaTag] { def value: String diff --git a/core/src/main/scala/io/github/rafafrdz/criteria4s/core/Predicate.scala b/core/src/main/scala/com/eff3ct/criteria4s/core/Predicate.scala similarity index 97% rename from core/src/main/scala/io/github/rafafrdz/criteria4s/core/Predicate.scala rename to core/src/main/scala/com/eff3ct/criteria4s/core/Predicate.scala index e3dfdfb..9fe9469 100644 --- a/core/src/main/scala/io/github/rafafrdz/criteria4s/core/Predicate.scala +++ b/core/src/main/scala/com/eff3ct/criteria4s/core/Predicate.scala @@ -1,7 +1,7 @@ -package io.github.rafafrdz.criteria4s.core +package com.eff3ct.criteria4s.core -import io.github.rafafrdz.criteria4s.core.Criteria._ -import io.github.rafafrdz.criteria4s.instances.builder.{BuilderBinary, BuilderUnary} +import com.eff3ct.criteria4s.core.Criteria._ +import com.eff3ct.criteria4s.instances.builder.{BuilderBinary, BuilderUnary} sealed trait Predicate[T <: CriteriaTag] diff --git a/core/src/main/scala/io/github/rafafrdz/criteria4s/core/Ref.scala b/core/src/main/scala/com/eff3ct/criteria4s/core/Ref.scala similarity index 96% rename from core/src/main/scala/io/github/rafafrdz/criteria4s/core/Ref.scala rename to core/src/main/scala/com/eff3ct/criteria4s/core/Ref.scala index 741b439..54317bd 100644 --- a/core/src/main/scala/io/github/rafafrdz/criteria4s/core/Ref.scala +++ b/core/src/main/scala/com/eff3ct/criteria4s/core/Ref.scala @@ -1,4 +1,4 @@ -package io.github.rafafrdz.criteria4s.core +package com.eff3ct.criteria4s.core sealed trait Ref[D <: CriteriaTag, V] { def asString(implicit show: Show[V, D]): String diff --git a/core/src/main/scala/io/github/rafafrdz/criteria4s/core/Show.scala b/core/src/main/scala/com/eff3ct/criteria4s/core/Show.scala similarity index 88% rename from core/src/main/scala/io/github/rafafrdz/criteria4s/core/Show.scala rename to core/src/main/scala/com/eff3ct/criteria4s/core/Show.scala index 0edecde..e597d55 100644 --- a/core/src/main/scala/io/github/rafafrdz/criteria4s/core/Show.scala +++ b/core/src/main/scala/com/eff3ct/criteria4s/core/Show.scala @@ -1,4 +1,4 @@ -package io.github.rafafrdz.criteria4s.core +package com.eff3ct.criteria4s.core trait Show[-V, D <: CriteriaTag] { def show(v: V): String diff --git a/core/src/main/scala/io/github/rafafrdz/criteria4s/core/package.scala b/core/src/main/scala/com/eff3ct/criteria4s/core/package.scala similarity index 96% rename from core/src/main/scala/io/github/rafafrdz/criteria4s/core/package.scala rename to core/src/main/scala/com/eff3ct/criteria4s/core/package.scala index 5534041..52dca85 100644 --- a/core/src/main/scala/io/github/rafafrdz/criteria4s/core/package.scala +++ b/core/src/main/scala/com/eff3ct/criteria4s/core/package.scala @@ -1,4 +1,4 @@ -package io.github.rafafrdz.criteria4s +package com.eff3ct.criteria4s package object core { diff --git a/core/src/main/scala/io/github/rafafrdz/criteria4s/extensions/conjunctions.scala b/core/src/main/scala/com/eff3ct/criteria4s/extensions/conjunctions.scala similarity index 76% rename from core/src/main/scala/io/github/rafafrdz/criteria4s/extensions/conjunctions.scala rename to core/src/main/scala/com/eff3ct/criteria4s/extensions/conjunctions.scala index fefb08b..2007cb2 100644 --- a/core/src/main/scala/io/github/rafafrdz/criteria4s/extensions/conjunctions.scala +++ b/core/src/main/scala/com/eff3ct/criteria4s/extensions/conjunctions.scala @@ -1,7 +1,7 @@ -package io.github.rafafrdz.criteria4s.extensions +package com.eff3ct.criteria4s.extensions -import io.github.rafafrdz.criteria4s.{functions => F} -import io.github.rafafrdz.criteria4s.core._ +import com.eff3ct.criteria4s.{functions => F} +import com.eff3ct.criteria4s.core._ trait conjunctions { diff --git a/core/src/main/scala/io/github/rafafrdz/criteria4s/extensions/package.scala b/core/src/main/scala/com/eff3ct/criteria4s/extensions/package.scala similarity index 62% rename from core/src/main/scala/io/github/rafafrdz/criteria4s/extensions/package.scala rename to core/src/main/scala/com/eff3ct/criteria4s/extensions/package.scala index d155eae..8d2fba1 100644 --- a/core/src/main/scala/io/github/rafafrdz/criteria4s/extensions/package.scala +++ b/core/src/main/scala/com/eff3ct/criteria4s/extensions/package.scala @@ -1,3 +1,3 @@ -package io.github.rafafrdz.criteria4s +package com.eff3ct.criteria4s package object extensions extends conjunctions with predicates diff --git a/core/src/main/scala/io/github/rafafrdz/criteria4s/extensions/predicates.scala b/core/src/main/scala/com/eff3ct/criteria4s/extensions/predicates.scala similarity index 84% rename from core/src/main/scala/io/github/rafafrdz/criteria4s/extensions/predicates.scala rename to core/src/main/scala/com/eff3ct/criteria4s/extensions/predicates.scala index 0ddcd4a..b7fd25a 100644 --- a/core/src/main/scala/io/github/rafafrdz/criteria4s/extensions/predicates.scala +++ b/core/src/main/scala/com/eff3ct/criteria4s/extensions/predicates.scala @@ -1,10 +1,10 @@ -package io.github.rafafrdz.criteria4s.extensions +package com.eff3ct.criteria4s.extensions -import io.github.rafafrdz.criteria4s.{functions => F} -import io.github.rafafrdz.criteria4s.core.{Criteria, CriteriaTag, Ref, Show} -import io.github.rafafrdz.criteria4s.core.PredicateBinary._ -import io.github.rafafrdz.criteria4s.core.PredicateUnary._ -import io.github.rafafrdz.criteria4s.core.Ref.Collection +import com.eff3ct.criteria4s.{functions => F} +import com.eff3ct.criteria4s.core.{Criteria, CriteriaTag, Ref, Show} +import com.eff3ct.criteria4s.core.PredicateBinary._ +import com.eff3ct.criteria4s.core.PredicateUnary._ +import com.eff3ct.criteria4s.core.Ref.Collection trait predicates { diff --git a/core/src/main/scala/io/github/rafafrdz/criteria4s/functions/conjunctions.scala b/core/src/main/scala/com/eff3ct/criteria4s/functions/conjunctions.scala similarity index 88% rename from core/src/main/scala/io/github/rafafrdz/criteria4s/functions/conjunctions.scala rename to core/src/main/scala/com/eff3ct/criteria4s/functions/conjunctions.scala index 3ae3057..0446767 100644 --- a/core/src/main/scala/io/github/rafafrdz/criteria4s/functions/conjunctions.scala +++ b/core/src/main/scala/com/eff3ct/criteria4s/functions/conjunctions.scala @@ -1,6 +1,6 @@ -package io.github.rafafrdz.criteria4s.functions +package com.eff3ct.criteria4s.functions -import io.github.rafafrdz.criteria4s.core._ +import com.eff3ct.criteria4s.core._ private[functions] trait conjunctions { diff --git a/core/src/main/scala/io/github/rafafrdz/criteria4s/functions/package.scala b/core/src/main/scala/com/eff3ct/criteria4s/functions/package.scala similarity index 89% rename from core/src/main/scala/io/github/rafafrdz/criteria4s/functions/package.scala rename to core/src/main/scala/com/eff3ct/criteria4s/functions/package.scala index 2d43ae4..bc92275 100644 --- a/core/src/main/scala/io/github/rafafrdz/criteria4s/functions/package.scala +++ b/core/src/main/scala/com/eff3ct/criteria4s/functions/package.scala @@ -1,6 +1,6 @@ -package io.github.rafafrdz.criteria4s +package com.eff3ct.criteria4s -import io.github.rafafrdz.criteria4s.core._ +import com.eff3ct.criteria4s.core._ package object functions extends predicates with conjunctions { diff --git a/core/src/main/scala/io/github/rafafrdz/criteria4s/functions/predicates.scala b/core/src/main/scala/com/eff3ct/criteria4s/functions/predicates.scala similarity index 91% rename from core/src/main/scala/io/github/rafafrdz/criteria4s/functions/predicates.scala rename to core/src/main/scala/com/eff3ct/criteria4s/functions/predicates.scala index 7ef4c42..0736a02 100644 --- a/core/src/main/scala/io/github/rafafrdz/criteria4s/functions/predicates.scala +++ b/core/src/main/scala/com/eff3ct/criteria4s/functions/predicates.scala @@ -1,9 +1,9 @@ -package io.github.rafafrdz.criteria4s.functions +package com.eff3ct.criteria4s.functions -import io.github.rafafrdz.criteria4s.core.{Column, Criteria, CriteriaTag, Ref, Show} -import io.github.rafafrdz.criteria4s.core.PredicateBinary._ -import io.github.rafafrdz.criteria4s.core.PredicateUnary._ -import io.github.rafafrdz.criteria4s.core.Ref._ +import com.eff3ct.criteria4s.core.{Column, Criteria, CriteriaTag, Ref, Show} +import com.eff3ct.criteria4s.core.PredicateBinary._ +import com.eff3ct.criteria4s.core.PredicateUnary._ +import com.eff3ct.criteria4s.core.Ref._ private[functions] trait predicates { diff --git a/core/src/main/scala/io/github/rafafrdz/criteria4s/instances/builder/BuilderBinary.scala b/core/src/main/scala/com/eff3ct/criteria4s/instances/builder/BuilderBinary.scala similarity index 50% rename from core/src/main/scala/io/github/rafafrdz/criteria4s/instances/builder/BuilderBinary.scala rename to core/src/main/scala/com/eff3ct/criteria4s/instances/builder/BuilderBinary.scala index 012fd7c..f87c370 100644 --- a/core/src/main/scala/io/github/rafafrdz/criteria4s/instances/builder/BuilderBinary.scala +++ b/core/src/main/scala/com/eff3ct/criteria4s/instances/builder/BuilderBinary.scala @@ -1,6 +1,6 @@ -package io.github.rafafrdz.criteria4s.instances.builder +package com.eff3ct.criteria4s.instances.builder -import io.github.rafafrdz.criteria4s.core.CriteriaTag +import com.eff3ct.criteria4s.core.CriteriaTag trait BuilderBinary[H[_ <: CriteriaTag]] { def build[T <: CriteriaTag](F: (String, String) => String): H[T] diff --git a/core/src/main/scala/com/eff3ct/criteria4s/instances/builder/BuilderUnary.scala b/core/src/main/scala/com/eff3ct/criteria4s/instances/builder/BuilderUnary.scala new file mode 100644 index 0000000..b0ffb65 --- /dev/null +++ b/core/src/main/scala/com/eff3ct/criteria4s/instances/builder/BuilderUnary.scala @@ -0,0 +1,7 @@ +package com.eff3ct.criteria4s.instances.builder + +import com.eff3ct.criteria4s.core.CriteriaTag + +trait BuilderUnary[H[_ <: CriteriaTag]] { + def build[T <: CriteriaTag](F: String => String): H[T] +} diff --git a/core/src/main/scala/io/github/rafafrdz/criteria4s/instances/package.scala b/core/src/main/scala/com/eff3ct/criteria4s/instances/package.scala similarity index 63% rename from core/src/main/scala/io/github/rafafrdz/criteria4s/instances/package.scala rename to core/src/main/scala/com/eff3ct/criteria4s/instances/package.scala index 7e930d9..70e71c0 100644 --- a/core/src/main/scala/io/github/rafafrdz/criteria4s/instances/package.scala +++ b/core/src/main/scala/com/eff3ct/criteria4s/instances/package.scala @@ -1,7 +1,7 @@ -package io.github.rafafrdz.criteria4s +package com.eff3ct.criteria4s -import io.github.rafafrdz.criteria4s.core.CriteriaTag -import io.github.rafafrdz.criteria4s.instances.builder.{BuilderBinary, BuilderUnary} +import com.eff3ct.criteria4s.core.CriteriaTag +import com.eff3ct.criteria4s.instances.builder.{BuilderBinary, BuilderUnary} package object instances { def build[T <: CriteriaTag, H[_ <: CriteriaTag]](F: (String, String) => String)(implicit diff --git a/core/src/main/scala/io/github/rafafrdz/criteria4s/instances/builder/BuilderUnary.scala b/core/src/main/scala/io/github/rafafrdz/criteria4s/instances/builder/BuilderUnary.scala deleted file mode 100644 index 323d52d..0000000 --- a/core/src/main/scala/io/github/rafafrdz/criteria4s/instances/builder/BuilderUnary.scala +++ /dev/null @@ -1,7 +0,0 @@ -package io.github.rafafrdz.criteria4s.instances.builder - -import io.github.rafafrdz.criteria4s.core.CriteriaTag - -trait BuilderUnary[H[_ <: CriteriaTag]] { - def build[T <: CriteriaTag](F: String => String): H[T] -} diff --git a/examples/src/main/scala/io/github/rafafrdz/criteria4s/examples/ArraysExample.scala b/examples/src/main/scala/com/eff3ct/criteria4s/examples/ArraysExample.scala similarity index 75% rename from examples/src/main/scala/io/github/rafafrdz/criteria4s/examples/ArraysExample.scala rename to examples/src/main/scala/com/eff3ct/criteria4s/examples/ArraysExample.scala index ee8ba37..c780d7a 100644 --- a/examples/src/main/scala/io/github/rafafrdz/criteria4s/examples/ArraysExample.scala +++ b/examples/src/main/scala/com/eff3ct/criteria4s/examples/ArraysExample.scala @@ -1,9 +1,9 @@ -package io.github.rafafrdz.criteria4s.examples +package com.eff3ct.criteria4s.examples -import io.github.rafafrdz.criteria4s.core._ -import io.github.rafafrdz.criteria4s.dialect.mongodb.MongoDB -import io.github.rafafrdz.criteria4s.examples.datastores.{Postgres, WeirdDatastore} -import io.github.rafafrdz.criteria4s.functions._ +import com.eff3ct.criteria4s.core._ +import com.eff3ct.criteria4s.dialect.mongodb.MongoDB +import com.eff3ct.criteria4s.examples.datastores.{Postgres, WeirdDatastore} +import com.eff3ct.criteria4s.functions._ object ArraysExample extends App { val aIsNull: Criteria[Postgres] = isNull(col("a")) diff --git a/examples/src/main/scala/io/github/rafafrdz/criteria4s/examples/BetweenExample.scala b/examples/src/main/scala/com/eff3ct/criteria4s/examples/BetweenExample.scala similarity index 63% rename from examples/src/main/scala/io/github/rafafrdz/criteria4s/examples/BetweenExample.scala rename to examples/src/main/scala/com/eff3ct/criteria4s/examples/BetweenExample.scala index 1cc6804..3af654d 100644 --- a/examples/src/main/scala/io/github/rafafrdz/criteria4s/examples/BetweenExample.scala +++ b/examples/src/main/scala/com/eff3ct/criteria4s/examples/BetweenExample.scala @@ -1,10 +1,10 @@ -package io.github.rafafrdz.criteria4s.examples +package com.eff3ct.criteria4s.examples -import io.github.rafafrdz.criteria4s.core._ -import io.github.rafafrdz.criteria4s.dialect.mongodb.MongoDB -import io.github.rafafrdz.criteria4s.examples.datastores.{Postgres, WeirdDatastore} -import io.github.rafafrdz.criteria4s.extensions._ -import io.github.rafafrdz.criteria4s.functions._ +import com.eff3ct.criteria4s.core._ +import com.eff3ct.criteria4s.dialect.mongodb.MongoDB +import com.eff3ct.criteria4s.examples.datastores.{Postgres, WeirdDatastore} +import com.eff3ct.criteria4s.extensions._ +import com.eff3ct.criteria4s.functions._ object BetweenExample extends App { val simpleBetween: Criteria[Postgres] = col[Postgres]("a").between(range(1, 10)) diff --git a/examples/src/main/scala/io/github/rafafrdz/criteria4s/examples/Example.scala b/examples/src/main/scala/com/eff3ct/criteria4s/examples/Example.scala similarity index 63% rename from examples/src/main/scala/io/github/rafafrdz/criteria4s/examples/Example.scala rename to examples/src/main/scala/com/eff3ct/criteria4s/examples/Example.scala index f96f44e..371d17a 100644 --- a/examples/src/main/scala/io/github/rafafrdz/criteria4s/examples/Example.scala +++ b/examples/src/main/scala/com/eff3ct/criteria4s/examples/Example.scala @@ -1,8 +1,8 @@ -package io.github.rafafrdz.criteria4s.examples +package com.eff3ct.criteria4s.examples -import io.github.rafafrdz.criteria4s.core._ -import io.github.rafafrdz.criteria4s.examples.datastores.Postgres -import io.github.rafafrdz.criteria4s.functions._ +import com.eff3ct.criteria4s.core._ +import com.eff3ct.criteria4s.examples.datastores.Postgres +import com.eff3ct.criteria4s.functions._ object Example extends App { diff --git a/examples/src/main/scala/io/github/rafafrdz/criteria4s/examples/Example2.scala b/examples/src/main/scala/com/eff3ct/criteria4s/examples/Example2.scala similarity index 75% rename from examples/src/main/scala/io/github/rafafrdz/criteria4s/examples/Example2.scala rename to examples/src/main/scala/com/eff3ct/criteria4s/examples/Example2.scala index 01753f4..87853b4 100644 --- a/examples/src/main/scala/io/github/rafafrdz/criteria4s/examples/Example2.scala +++ b/examples/src/main/scala/com/eff3ct/criteria4s/examples/Example2.scala @@ -1,9 +1,9 @@ -package io.github.rafafrdz.criteria4s.examples +package com.eff3ct.criteria4s.examples -import io.github.rafafrdz.criteria4s.core._ -import io.github.rafafrdz.criteria4s.examples.datastores.Postgres -import io.github.rafafrdz.criteria4s.extensions._ -import io.github.rafafrdz.criteria4s.functions._ +import com.eff3ct.criteria4s.core._ +import com.eff3ct.criteria4s.examples.datastores.Postgres +import com.eff3ct.criteria4s.extensions._ +import com.eff3ct.criteria4s.functions._ object Example2 extends App { diff --git a/examples/src/main/scala/io/github/rafafrdz/criteria4s/examples/Example3.scala b/examples/src/main/scala/com/eff3ct/criteria4s/examples/Example3.scala similarity index 77% rename from examples/src/main/scala/io/github/rafafrdz/criteria4s/examples/Example3.scala rename to examples/src/main/scala/com/eff3ct/criteria4s/examples/Example3.scala index b56e74d..f66bc57 100644 --- a/examples/src/main/scala/io/github/rafafrdz/criteria4s/examples/Example3.scala +++ b/examples/src/main/scala/com/eff3ct/criteria4s/examples/Example3.scala @@ -1,9 +1,9 @@ -package io.github.rafafrdz.criteria4s.examples +package com.eff3ct.criteria4s.examples -import io.github.rafafrdz.criteria4s.core._ -import io.github.rafafrdz.criteria4s.dialect.mongodb.MongoDB -import io.github.rafafrdz.criteria4s.examples.datastores.{Postgres, WeirdDatastore} -import io.github.rafafrdz.criteria4s.functions._ +import com.eff3ct.criteria4s.core._ +import com.eff3ct.criteria4s.dialect.mongodb.MongoDB +import com.eff3ct.criteria4s.examples.datastores.{Postgres, WeirdDatastore} +import com.eff3ct.criteria4s.functions._ object Example3 extends App { diff --git a/examples/src/main/scala/io/github/rafafrdz/criteria4s/examples/Example4.scala b/examples/src/main/scala/com/eff3ct/criteria4s/examples/Example4.scala similarity index 78% rename from examples/src/main/scala/io/github/rafafrdz/criteria4s/examples/Example4.scala rename to examples/src/main/scala/com/eff3ct/criteria4s/examples/Example4.scala index 0fd5733..a9a7db0 100644 --- a/examples/src/main/scala/io/github/rafafrdz/criteria4s/examples/Example4.scala +++ b/examples/src/main/scala/com/eff3ct/criteria4s/examples/Example4.scala @@ -1,10 +1,10 @@ -package io.github.rafafrdz.criteria4s.examples +package com.eff3ct.criteria4s.examples -import io.github.rafafrdz.criteria4s.core._ -import io.github.rafafrdz.criteria4s.dialect.mongodb.MongoDB -import io.github.rafafrdz.criteria4s.examples.datastores.{MySQL, Postgres, WeirdDatastore} -import io.github.rafafrdz.criteria4s.extensions._ -import io.github.rafafrdz.criteria4s.functions._ +import com.eff3ct.criteria4s.core._ +import com.eff3ct.criteria4s.dialect.mongodb.MongoDB +import com.eff3ct.criteria4s.examples.datastores.{MySQL, Postgres, WeirdDatastore} +import com.eff3ct.criteria4s.extensions._ +import com.eff3ct.criteria4s.functions._ object Example4 extends App { diff --git a/examples/src/main/scala/io/github/rafafrdz/criteria4s/examples/FilterByUserExample.scala b/examples/src/main/scala/com/eff3ct/criteria4s/examples/FilterByUserExample.scala similarity index 69% rename from examples/src/main/scala/io/github/rafafrdz/criteria4s/examples/FilterByUserExample.scala rename to examples/src/main/scala/com/eff3ct/criteria4s/examples/FilterByUserExample.scala index 1838830..cdc61e1 100644 --- a/examples/src/main/scala/io/github/rafafrdz/criteria4s/examples/FilterByUserExample.scala +++ b/examples/src/main/scala/com/eff3ct/criteria4s/examples/FilterByUserExample.scala @@ -1,10 +1,10 @@ -package io.github.rafafrdz.criteria4s.examples +package com.eff3ct.criteria4s.examples -import io.github.rafafrdz.criteria4s.core._ -import io.github.rafafrdz.criteria4s.dialect.mongodb.MongoDB -import io.github.rafafrdz.criteria4s.examples.datastores.{MySQL, Postgres, WeirdDatastore} -import io.github.rafafrdz.criteria4s.extensions._ -import io.github.rafafrdz.criteria4s.functions._ +import com.eff3ct.criteria4s.core._ +import com.eff3ct.criteria4s.dialect.mongodb.MongoDB +import com.eff3ct.criteria4s.examples.datastores.{MySQL, Postgres, WeirdDatastore} +import com.eff3ct.criteria4s.extensions._ +import com.eff3ct.criteria4s.functions._ import java.util.UUID diff --git a/examples/src/main/scala/io/github/rafafrdz/criteria4s/examples/NotExample.scala b/examples/src/main/scala/com/eff3ct/criteria4s/examples/NotExample.scala similarity index 79% rename from examples/src/main/scala/io/github/rafafrdz/criteria4s/examples/NotExample.scala rename to examples/src/main/scala/com/eff3ct/criteria4s/examples/NotExample.scala index 8432b45..80b24c1 100644 --- a/examples/src/main/scala/io/github/rafafrdz/criteria4s/examples/NotExample.scala +++ b/examples/src/main/scala/com/eff3ct/criteria4s/examples/NotExample.scala @@ -1,10 +1,10 @@ -package io.github.rafafrdz.criteria4s.examples +package com.eff3ct.criteria4s.examples -import io.github.rafafrdz.criteria4s.core._ -import io.github.rafafrdz.criteria4s.dialect.mongodb.MongoDB -import io.github.rafafrdz.criteria4s.examples.datastores._ -import io.github.rafafrdz.criteria4s.extensions._ -import io.github.rafafrdz.criteria4s.functions._ +import com.eff3ct.criteria4s.core._ +import com.eff3ct.criteria4s.dialect.mongodb.MongoDB +import com.eff3ct.criteria4s.examples.datastores._ +import com.eff3ct.criteria4s.extensions._ +import com.eff3ct.criteria4s.functions._ object NotExample extends App { diff --git a/examples/src/main/scala/io/github/rafafrdz/criteria4s/examples/datastores/MySQL.scala b/examples/src/main/scala/com/eff3ct/criteria4s/examples/datastores/MySQL.scala similarity index 56% rename from examples/src/main/scala/io/github/rafafrdz/criteria4s/examples/datastores/MySQL.scala rename to examples/src/main/scala/com/eff3ct/criteria4s/examples/datastores/MySQL.scala index 0fd1460..c056750 100644 --- a/examples/src/main/scala/io/github/rafafrdz/criteria4s/examples/datastores/MySQL.scala +++ b/examples/src/main/scala/com/eff3ct/criteria4s/examples/datastores/MySQL.scala @@ -1,9 +1,9 @@ -package io.github.rafafrdz.criteria4s.examples.datastores +package com.eff3ct.criteria4s.examples.datastores -import io.github.rafafrdz.criteria4s.core.PredicateBinary._ -import io.github.rafafrdz.criteria4s.core.{Column, Show} -import io.github.rafafrdz.criteria4s.instances._ -import io.github.rafafrdz.criteria4s.dialect.sql._ +import com.eff3ct.criteria4s.core.PredicateBinary._ +import com.eff3ct.criteria4s.core.{Column, Show} +import com.eff3ct.criteria4s.instances._ +import com.eff3ct.criteria4s.dialect.sql._ trait MySQL extends SQL diff --git a/examples/src/main/scala/io/github/rafafrdz/criteria4s/examples/datastores/Postgres.scala b/examples/src/main/scala/com/eff3ct/criteria4s/examples/datastores/Postgres.scala similarity index 77% rename from examples/src/main/scala/io/github/rafafrdz/criteria4s/examples/datastores/Postgres.scala rename to examples/src/main/scala/com/eff3ct/criteria4s/examples/datastores/Postgres.scala index 9b2eab3..8c0d2bf 100644 --- a/examples/src/main/scala/io/github/rafafrdz/criteria4s/examples/datastores/Postgres.scala +++ b/examples/src/main/scala/com/eff3ct/criteria4s/examples/datastores/Postgres.scala @@ -1,7 +1,7 @@ -package io.github.rafafrdz.criteria4s.examples.datastores +package com.eff3ct.criteria4s.examples.datastores -import io.github.rafafrdz.criteria4s.core.{Column, Show} -import io.github.rafafrdz.criteria4s.dialect.sql.{SQL, _} +import com.eff3ct.criteria4s.core.{Column, Show} +import com.eff3ct.criteria4s.dialect.sql.{SQL, _} trait Postgres extends SQL object Postgres extends SQLExpr[Postgres] { diff --git a/examples/src/main/scala/io/github/rafafrdz/criteria4s/examples/datastores/WeirdDatastore.scala b/examples/src/main/scala/com/eff3ct/criteria4s/examples/datastores/WeirdDatastore.scala similarity index 93% rename from examples/src/main/scala/io/github/rafafrdz/criteria4s/examples/datastores/WeirdDatastore.scala rename to examples/src/main/scala/com/eff3ct/criteria4s/examples/datastores/WeirdDatastore.scala index 590590f..fd386ab 100644 --- a/examples/src/main/scala/io/github/rafafrdz/criteria4s/examples/datastores/WeirdDatastore.scala +++ b/examples/src/main/scala/com/eff3ct/criteria4s/examples/datastores/WeirdDatastore.scala @@ -1,7 +1,7 @@ -package io.github.rafafrdz.criteria4s.examples.datastores +package com.eff3ct.criteria4s.examples.datastores -import io.github.rafafrdz.criteria4s.core._ -import io.github.rafafrdz.criteria4s.instances._ +import com.eff3ct.criteria4s.core._ +import com.eff3ct.criteria4s.instances._ trait WeirdDatastore extends CriteriaTag diff --git a/mongodb/src/main/scala/io/github/rafafrdz/criteria4s/dialect/mongodb/MongoDB.scala b/mongodb/src/main/scala/com/eff3ct/criteria4s/dialect/mongodb/MongoDB.scala similarity index 94% rename from mongodb/src/main/scala/io/github/rafafrdz/criteria4s/dialect/mongodb/MongoDB.scala rename to mongodb/src/main/scala/com/eff3ct/criteria4s/dialect/mongodb/MongoDB.scala index 378318c..f05f530 100644 --- a/mongodb/src/main/scala/io/github/rafafrdz/criteria4s/dialect/mongodb/MongoDB.scala +++ b/mongodb/src/main/scala/com/eff3ct/criteria4s/dialect/mongodb/MongoDB.scala @@ -1,7 +1,7 @@ -package io.github.rafafrdz.criteria4s.dialect.mongodb +package com.eff3ct.criteria4s.dialect.mongodb -import io.github.rafafrdz.criteria4s.core._ -import io.github.rafafrdz.criteria4s.instances._ +import com.eff3ct.criteria4s.core._ +import com.eff3ct.criteria4s.instances._ trait MongoDB extends CriteriaTag diff --git a/mongodb/src/main/scala/io/github/rafafrdz/criteria4s/dialect/mongodb/package.scala b/mongodb/src/main/scala/com/eff3ct/criteria4s/dialect/mongodb/package.scala similarity index 72% rename from mongodb/src/main/scala/io/github/rafafrdz/criteria4s/dialect/mongodb/package.scala rename to mongodb/src/main/scala/com/eff3ct/criteria4s/dialect/mongodb/package.scala index ae272b3..de01f6b 100644 --- a/mongodb/src/main/scala/io/github/rafafrdz/criteria4s/dialect/mongodb/package.scala +++ b/mongodb/src/main/scala/com/eff3ct/criteria4s/dialect/mongodb/package.scala @@ -1,4 +1,4 @@ -package io.github.rafafrdz.criteria4s.dialect +package com.eff3ct.criteria4s.dialect package object mongodb extends MongoDB.MongoDBExpr[MongoDB] { type MongoDBExpr[T <: MongoDB] = MongoDB.MongoDBExpr[T] diff --git a/sql/src/main/scala/io/github/rafafrdz/criteria4s/dialect/sql/SQL.scala b/sql/src/main/scala/com/eff3ct/criteria4s/dialect/sql/SQL.scala similarity index 94% rename from sql/src/main/scala/io/github/rafafrdz/criteria4s/dialect/sql/SQL.scala rename to sql/src/main/scala/com/eff3ct/criteria4s/dialect/sql/SQL.scala index 3a55e2c..509dd06 100644 --- a/sql/src/main/scala/io/github/rafafrdz/criteria4s/dialect/sql/SQL.scala +++ b/sql/src/main/scala/com/eff3ct/criteria4s/dialect/sql/SQL.scala @@ -1,7 +1,7 @@ -package io.github.rafafrdz.criteria4s.dialect.sql +package com.eff3ct.criteria4s.dialect.sql -import io.github.rafafrdz.criteria4s.core._ -import io.github.rafafrdz.criteria4s.instances._ +import com.eff3ct.criteria4s.core._ +import com.eff3ct.criteria4s.instances._ trait SQL extends CriteriaTag diff --git a/sql/src/main/scala/io/github/rafafrdz/criteria4s/dialect/sql/package.scala b/sql/src/main/scala/com/eff3ct/criteria4s/dialect/sql/package.scala similarity index 66% rename from sql/src/main/scala/io/github/rafafrdz/criteria4s/dialect/sql/package.scala rename to sql/src/main/scala/com/eff3ct/criteria4s/dialect/sql/package.scala index ca192e6..a57b975 100644 --- a/sql/src/main/scala/io/github/rafafrdz/criteria4s/dialect/sql/package.scala +++ b/sql/src/main/scala/com/eff3ct/criteria4s/dialect/sql/package.scala @@ -1,4 +1,4 @@ -package io.github.rafafrdz.criteria4s.dialect +package com.eff3ct.criteria4s.dialect package object sql extends SQL.SQLExpr[SQL] { From 4a31bd69c29db0d4c6dc869cea697c9efacd455b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Fern=C3=A1ndez?= Date: Tue, 24 Dec 2024 14:00:46 +0100 Subject: [PATCH 6/7] README.md --- README.md | 105 ++++++++++----------------------------- doc/formal-definition.md | 22 ++++++++ 2 files changed, 47 insertions(+), 80 deletions(-) create mode 100644 doc/formal-definition.md diff --git a/README.md b/README.md index 7453306..6747239 100644 --- a/README.md +++ b/README.md @@ -1,87 +1,35 @@ -![Sonatype Nexus (Releases)](https://img.shields.io/nexus/r/com.eff3ct/criteria4s-core_2.13?server=https%3A%2F%2Fs01.oss.sonatype.org&style=flat-square&label=Sonatype&labelColor=%20&color=%2acf45%20%20) [![License](https://img.shields.io/badge/license-Apache%202-blue.svg?style=flat-square&label=License)](https://github.com/rafafrdz/criteria4s?tab=Apache-2.0-1-ov-file#readme) +![Sonatype Nexus (Releases)](https://img.shields.io/nexus/r/com.eff3ct/criteria4s-core_2.13?server=https%3A%2F%2Fs01.oss.sonatype.org&style=flat-square&label=Sonatype&labelColor=%20&color=%2acf45%20%20) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) # Criteria4s -Criteria4s is a simple domain-specific language (DSL) to define criteria and predicate expressions for any data stores -by using Scala type class mechanisms in a type-safe way. It pretends to be agnostic to any data store, and it is -extensible to support any kind of data stores. - -## Formal Definition of the Expressions - -The formal definition of the Criteria4s' type-classes (expressions) is as follows: - -```text -Criteria := Conjuction Criteria Criteria | Predicate | Value -Predicate := UnaryPred Ref | BinaryPred Ref Ref -Ref := Value | Col -Conjuction := AND | OR -UnaryPred := IS_NULL | IS_NOT_NULL ... -BinaryPred := EQ | NEQ | GT | LT | GEQ | LEQ | IN | LIKE ... -``` - -Where: - -- `Criteria` is the main expression of the DSL -- `Conjuction` is the conjunction operator expression -- `UnaryPredOp` is the unary predicate operator expression -- `BinaryPredOp` is the binary predicate operator expression -- `Ref` is a reference to a value or a column -- `Value` is a value expression of a certain type `T` -- `Col` is a column expression +Criteria4s is a straightforward domain-specific language (DSL) designed to define criteria and predicate expressions for any data store using Scala's type class mechanisms in a type-safe manner. Its core is designed to be agnostic to any specific data store, making it extensible and capable of supporting a variety of data storage systems. ## Getting Started -To use dsl of Criteria4s, you need to add the following dependency to your project: +To utilize the Criteria4s DSL in your project, add the following dependencies to your build configuration: -**SonaType Repository** +### Sonatype Repository -- Core library: [criteria4s-core](https://central.sonatype.com/artifact/com.eff3ct/criteria4s-core_2.13) -- SQL implementation: [criteria4s-sql](https://central.sonatype.com/artifact/com.eff3ct/criteria4s-sql_2.13) -- MongoDB dialect - implementation: [criteria4s-mongodb](https://central.sonatype.com/artifact/com.eff3ct/criteria4s-mongodb_2.13) +- **Core library**: [criteria4s-core](https://central.sonatype.com/artifact/com.eff3ct/criteria4s-core_2.13) +- **SQL implementation**: [criteria4s-sql](https://central.sonatype.com/artifact/com.eff3ct/criteria4s-sql_2.13) +- **MongoDB implementation**: [criteria4s-mongodb](https://central.sonatype.com/artifact/com.eff3ct/criteria4s-mongodb_2.13) -**SBT** +### SBT + +Add these to your `build.sbt`: ```scala libraryDependencies += "com.eff3ct" %% "criteria4s-core" % "" // Core library libraryDependencies += "com.eff3ct" %% "criteria4s-sql" % "" // SQL implementation libraryDependencies += "com.eff3ct" %% "criteria4s-mongodb" % "" // MongoDB implementation - -``` - -**Maven** - -```xml - - - - com.eff3ct - criteria4s-core_2.13 - 0.8.2 - - - - - com.eff3ct - criteria4s-core_2.13 - 0.8.2 - - - - - com.eff3ct - criteria4s-mongodb_2.13 - 0.8.2 - - ``` > [!IMPORTANT] -> Criteria4s is a work in progress and it is not ready for production use. Also, it is just available for Scala 2.13. +> Criteria4s is currently a work in progress and not ready for production use. It is available exclusively for Scala 2.13. -## Dialects +## Dialects Supported -Criteria4s is extensible to support any kind of data stores. Currently, it supports the following **dialects**: +Criteria4s is extensible, supporting various types of data stores. Presently, it supports the following dialects: | Dialect | Package | |-------------|:-------------------------------------------------------------------------------------------| @@ -91,12 +39,11 @@ Criteria4s is extensible to support any kind of data stores. Currently, it suppo ## Examples -Here, we will show some examples of how to use the Criteria DSL. You can find more examples in -the [`criteria4s-examples`](./examples/src/main/scala/io/github/rafafrdz/criteria4s/examples) module. +Here are examples demonstrating how to use the Criteria DSL. More samples are available in the [`criteria4s-examples`](./examples/src/main/scala/io/github/rafafrdz/criteria4s/examples) module. ### Imports -First, we need to import the Criteria4s DSL and the SQL dialect: +Start by importing the Criteria4s DSL and the SQL dialect: ```scala import com.eff3ct.criteria4s.core._ @@ -107,16 +54,16 @@ import com.eff3ct.criteria4s.functions._ ### Defining Criteria Expressions -We can define criteria expressions in a polymorphic way by using the Criteria DSL. You can find more definitions -examples -in the [`Defining Criteria Expressions`](./doc/defining-criteria-expressions.md) document. +Define criteria expressions in a polymorphic way using the Criteria DSL. Additional examples are provided in the [`Defining Criteria Expressions`](./doc/defining-criteria-expressions.md) document. ```scala def expr[T <: CriteriaTag : LEQ : EQ : AND : OR : Show[Column, *]]: Criteria[T] = (col[T]("field1") leq lit(3)) and (col[T]("field2") leq lit(4)) or (col[T]("field3") === lit("c")) ``` -#### Case of use +#### Use Cases + +The following code snippets demonstrate how to use the defined criteria expressions: ```scala def ageCriteria[T <: CriteriaTag : GT : LT : AND : Show[Column, *]]: Criteria[T] = @@ -128,18 +75,16 @@ def refCriteria[T <: CriteriaTag : EQ : Show[Column, *]](fieldName: String, id: ### Evaluating Criteria Expressions -And then we can use those expressions defined belows in order to generate criteria expressions for different -datastores by importing the corresponding dialects. You can find evaluation examples for some different dialects in the -following documents: +Utilize these expressions to generate criteria for different data stores by importing the corresponding dialects. Evaluation examples for various dialects are available in the following documents: -- [PostgreSQL Dialect](./doc/postgresql-dialect-evaluating.md) -- [MongoDB Dialect](./doc/mongodb-dialect-evaluating.md) -- [MySQL Dialect](./doc/mysql-dialect-evaluating.md) -- [Custom Dialect](./doc/custom-dialect-evaluating.md) +- [PostgreSQL Dialect](./doc/postgresql-dialect-evaluating.md): Evaluate criteria expressions for PostgreSQL data stores. +- [MongoDB Dialect](./doc/mongodb-dialect-evaluating.md): Evaluate criteria expressions for MongoDB data stores. +- [MySQL Dialect](./doc/mysql-dialect-evaluating.md): Evaluate criteria expressions for MySQL data stores. +- [Custom Dialect](./doc/custom-dialect-evaluating.md): Evaluate criteria expressions for custom data stores. ### Inline Criteria DSL -Or maybe we can use the Criteria DSL inline: +Leverage the Criteria DSL in an inline manner: ```scala (col[PostgreSQL]("field1") leq lit(3)) and (col[PostgreSQL]("field2") leq lit(4)) or (col[PostgreSQL]("field3") === lit("c")) diff --git a/doc/formal-definition.md b/doc/formal-definition.md new file mode 100644 index 0000000..464b385 --- /dev/null +++ b/doc/formal-definition.md @@ -0,0 +1,22 @@ +## Formal Definition of the Expressions + +The formal definition of the Criteria4s' type-classes (expressions) is as follows: + +```text +Criteria := Conjuction Criteria Criteria | Predicate | Value +Predicate := UnaryPred Ref | BinaryPred Ref Ref +Ref := Value | Col +Conjuction := AND | OR +UnaryPred := IS_NULL | IS_NOT_NULL ... +BinaryPred := EQ | NEQ | GT | LT | GEQ | LEQ | IN | LIKE ... +``` + +Where: + +- `Criteria` is the main expression of the DSL +- `Conjuction` is the conjunction operator expression +- `UnaryPredOp` is the unary predicate operator expression +- `BinaryPredOp` is the binary predicate operator expression +- `Ref` is a reference to a value or a column +- `Value` is a value expression of a certain type `T` +- `Col` is a column expression \ No newline at end of file From f5f943de398a701466d4f9ff2ff5198ba0d96d43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Fern=C3=A1ndez?= Date: Tue, 24 Dec 2024 14:08:24 +0100 Subject: [PATCH 7/7] header and format --- .../eff3ct/criteria4s/core/Conjuction.scala | 24 +++++++++++++++++++ .../com/eff3ct/criteria4s/core/Criteria.scala | 24 +++++++++++++++++++ .../eff3ct/criteria4s/core/Predicate.scala | 24 +++++++++++++++++++ .../com/eff3ct/criteria4s/core/Ref.scala | 24 +++++++++++++++++++ .../com/eff3ct/criteria4s/core/Show.scala | 24 +++++++++++++++++++ .../com/eff3ct/criteria4s/core/package.scala | 24 +++++++++++++++++++ .../criteria4s/extensions/conjunctions.scala | 24 +++++++++++++++++++ .../criteria4s/extensions/package.scala | 24 +++++++++++++++++++ .../criteria4s/extensions/predicates.scala | 24 +++++++++++++++++++ .../criteria4s/functions/conjunctions.scala | 24 +++++++++++++++++++ .../eff3ct/criteria4s/functions/package.scala | 24 +++++++++++++++++++ .../criteria4s/functions/predicates.scala | 24 +++++++++++++++++++ .../instances/builder/BuilderBinary.scala | 24 +++++++++++++++++++ .../instances/builder/BuilderUnary.scala | 24 +++++++++++++++++++ .../eff3ct/criteria4s/instances/package.scala | 24 +++++++++++++++++++ .../criteria4s/examples/ArraysExample.scala | 24 +++++++++++++++++++ .../criteria4s/examples/BetweenExample.scala | 24 +++++++++++++++++++ .../eff3ct/criteria4s/examples/Example.scala | 24 +++++++++++++++++++ .../eff3ct/criteria4s/examples/Example2.scala | 24 +++++++++++++++++++ .../eff3ct/criteria4s/examples/Example3.scala | 24 +++++++++++++++++++ .../eff3ct/criteria4s/examples/Example4.scala | 24 +++++++++++++++++++ .../examples/FilterByUserExample.scala | 24 +++++++++++++++++++ .../criteria4s/examples/NotExample.scala | 24 +++++++++++++++++++ .../examples/datastores/MySQL.scala | 24 +++++++++++++++++++ .../examples/datastores/Postgres.scala | 24 +++++++++++++++++++ .../examples/datastores/WeirdDatastore.scala | 24 +++++++++++++++++++ .../criteria4s/dialect/mongodb/MongoDB.scala | 24 +++++++++++++++++++ .../criteria4s/dialect/mongodb/package.scala | 24 +++++++++++++++++++ project/Build.scala | 8 +++---- .../eff3ct/criteria4s/dialect/sql/SQL.scala | 24 +++++++++++++++++++ .../criteria4s/dialect/sql/package.scala | 24 +++++++++++++++++++ 31 files changed, 724 insertions(+), 4 deletions(-) diff --git a/core/src/main/scala/com/eff3ct/criteria4s/core/Conjuction.scala b/core/src/main/scala/com/eff3ct/criteria4s/core/Conjuction.scala index ea37979..909d043 100644 --- a/core/src/main/scala/com/eff3ct/criteria4s/core/Conjuction.scala +++ b/core/src/main/scala/com/eff3ct/criteria4s/core/Conjuction.scala @@ -1,3 +1,27 @@ +/* + * MIT License + * + * Copyright (c) 2024 Rafael Fernandez + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.eff3ct.criteria4s.core import com.eff3ct.criteria4s.core diff --git a/core/src/main/scala/com/eff3ct/criteria4s/core/Criteria.scala b/core/src/main/scala/com/eff3ct/criteria4s/core/Criteria.scala index 0495743..b985db8 100644 --- a/core/src/main/scala/com/eff3ct/criteria4s/core/Criteria.scala +++ b/core/src/main/scala/com/eff3ct/criteria4s/core/Criteria.scala @@ -1,3 +1,27 @@ +/* + * MIT License + * + * Copyright (c) 2024 Rafael Fernandez + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.eff3ct.criteria4s.core trait Criteria[T <: CriteriaTag] { diff --git a/core/src/main/scala/com/eff3ct/criteria4s/core/Predicate.scala b/core/src/main/scala/com/eff3ct/criteria4s/core/Predicate.scala index 9fe9469..58fe04f 100644 --- a/core/src/main/scala/com/eff3ct/criteria4s/core/Predicate.scala +++ b/core/src/main/scala/com/eff3ct/criteria4s/core/Predicate.scala @@ -1,3 +1,27 @@ +/* + * MIT License + * + * Copyright (c) 2024 Rafael Fernandez + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.eff3ct.criteria4s.core import com.eff3ct.criteria4s.core.Criteria._ diff --git a/core/src/main/scala/com/eff3ct/criteria4s/core/Ref.scala b/core/src/main/scala/com/eff3ct/criteria4s/core/Ref.scala index 54317bd..3b9c722 100644 --- a/core/src/main/scala/com/eff3ct/criteria4s/core/Ref.scala +++ b/core/src/main/scala/com/eff3ct/criteria4s/core/Ref.scala @@ -1,3 +1,27 @@ +/* + * MIT License + * + * Copyright (c) 2024 Rafael Fernandez + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.eff3ct.criteria4s.core sealed trait Ref[D <: CriteriaTag, V] { diff --git a/core/src/main/scala/com/eff3ct/criteria4s/core/Show.scala b/core/src/main/scala/com/eff3ct/criteria4s/core/Show.scala index e597d55..63927f5 100644 --- a/core/src/main/scala/com/eff3ct/criteria4s/core/Show.scala +++ b/core/src/main/scala/com/eff3ct/criteria4s/core/Show.scala @@ -1,3 +1,27 @@ +/* + * MIT License + * + * Copyright (c) 2024 Rafael Fernandez + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.eff3ct.criteria4s.core trait Show[-V, D <: CriteriaTag] { diff --git a/core/src/main/scala/com/eff3ct/criteria4s/core/package.scala b/core/src/main/scala/com/eff3ct/criteria4s/core/package.scala index 52dca85..c305e73 100644 --- a/core/src/main/scala/com/eff3ct/criteria4s/core/package.scala +++ b/core/src/main/scala/com/eff3ct/criteria4s/core/package.scala @@ -1,3 +1,27 @@ +/* + * MIT License + * + * Copyright (c) 2024 Rafael Fernandez + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.eff3ct.criteria4s package object core { diff --git a/core/src/main/scala/com/eff3ct/criteria4s/extensions/conjunctions.scala b/core/src/main/scala/com/eff3ct/criteria4s/extensions/conjunctions.scala index 2007cb2..d31d743 100644 --- a/core/src/main/scala/com/eff3ct/criteria4s/extensions/conjunctions.scala +++ b/core/src/main/scala/com/eff3ct/criteria4s/extensions/conjunctions.scala @@ -1,3 +1,27 @@ +/* + * MIT License + * + * Copyright (c) 2024 Rafael Fernandez + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.eff3ct.criteria4s.extensions import com.eff3ct.criteria4s.{functions => F} diff --git a/core/src/main/scala/com/eff3ct/criteria4s/extensions/package.scala b/core/src/main/scala/com/eff3ct/criteria4s/extensions/package.scala index 8d2fba1..c3979d1 100644 --- a/core/src/main/scala/com/eff3ct/criteria4s/extensions/package.scala +++ b/core/src/main/scala/com/eff3ct/criteria4s/extensions/package.scala @@ -1,3 +1,27 @@ +/* + * MIT License + * + * Copyright (c) 2024 Rafael Fernandez + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.eff3ct.criteria4s package object extensions extends conjunctions with predicates diff --git a/core/src/main/scala/com/eff3ct/criteria4s/extensions/predicates.scala b/core/src/main/scala/com/eff3ct/criteria4s/extensions/predicates.scala index b7fd25a..9c961b0 100644 --- a/core/src/main/scala/com/eff3ct/criteria4s/extensions/predicates.scala +++ b/core/src/main/scala/com/eff3ct/criteria4s/extensions/predicates.scala @@ -1,3 +1,27 @@ +/* + * MIT License + * + * Copyright (c) 2024 Rafael Fernandez + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.eff3ct.criteria4s.extensions import com.eff3ct.criteria4s.{functions => F} diff --git a/core/src/main/scala/com/eff3ct/criteria4s/functions/conjunctions.scala b/core/src/main/scala/com/eff3ct/criteria4s/functions/conjunctions.scala index 0446767..ec56e64 100644 --- a/core/src/main/scala/com/eff3ct/criteria4s/functions/conjunctions.scala +++ b/core/src/main/scala/com/eff3ct/criteria4s/functions/conjunctions.scala @@ -1,3 +1,27 @@ +/* + * MIT License + * + * Copyright (c) 2024 Rafael Fernandez + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.eff3ct.criteria4s.functions import com.eff3ct.criteria4s.core._ diff --git a/core/src/main/scala/com/eff3ct/criteria4s/functions/package.scala b/core/src/main/scala/com/eff3ct/criteria4s/functions/package.scala index bc92275..71f13ea 100644 --- a/core/src/main/scala/com/eff3ct/criteria4s/functions/package.scala +++ b/core/src/main/scala/com/eff3ct/criteria4s/functions/package.scala @@ -1,3 +1,27 @@ +/* + * MIT License + * + * Copyright (c) 2024 Rafael Fernandez + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.eff3ct.criteria4s import com.eff3ct.criteria4s.core._ diff --git a/core/src/main/scala/com/eff3ct/criteria4s/functions/predicates.scala b/core/src/main/scala/com/eff3ct/criteria4s/functions/predicates.scala index 0736a02..c8a87fd 100644 --- a/core/src/main/scala/com/eff3ct/criteria4s/functions/predicates.scala +++ b/core/src/main/scala/com/eff3ct/criteria4s/functions/predicates.scala @@ -1,3 +1,27 @@ +/* + * MIT License + * + * Copyright (c) 2024 Rafael Fernandez + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.eff3ct.criteria4s.functions import com.eff3ct.criteria4s.core.{Column, Criteria, CriteriaTag, Ref, Show} diff --git a/core/src/main/scala/com/eff3ct/criteria4s/instances/builder/BuilderBinary.scala b/core/src/main/scala/com/eff3ct/criteria4s/instances/builder/BuilderBinary.scala index f87c370..fca1595 100644 --- a/core/src/main/scala/com/eff3ct/criteria4s/instances/builder/BuilderBinary.scala +++ b/core/src/main/scala/com/eff3ct/criteria4s/instances/builder/BuilderBinary.scala @@ -1,3 +1,27 @@ +/* + * MIT License + * + * Copyright (c) 2024 Rafael Fernandez + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.eff3ct.criteria4s.instances.builder import com.eff3ct.criteria4s.core.CriteriaTag diff --git a/core/src/main/scala/com/eff3ct/criteria4s/instances/builder/BuilderUnary.scala b/core/src/main/scala/com/eff3ct/criteria4s/instances/builder/BuilderUnary.scala index b0ffb65..fa79487 100644 --- a/core/src/main/scala/com/eff3ct/criteria4s/instances/builder/BuilderUnary.scala +++ b/core/src/main/scala/com/eff3ct/criteria4s/instances/builder/BuilderUnary.scala @@ -1,3 +1,27 @@ +/* + * MIT License + * + * Copyright (c) 2024 Rafael Fernandez + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.eff3ct.criteria4s.instances.builder import com.eff3ct.criteria4s.core.CriteriaTag diff --git a/core/src/main/scala/com/eff3ct/criteria4s/instances/package.scala b/core/src/main/scala/com/eff3ct/criteria4s/instances/package.scala index 70e71c0..4bd7cf7 100644 --- a/core/src/main/scala/com/eff3ct/criteria4s/instances/package.scala +++ b/core/src/main/scala/com/eff3ct/criteria4s/instances/package.scala @@ -1,3 +1,27 @@ +/* + * MIT License + * + * Copyright (c) 2024 Rafael Fernandez + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.eff3ct.criteria4s import com.eff3ct.criteria4s.core.CriteriaTag diff --git a/examples/src/main/scala/com/eff3ct/criteria4s/examples/ArraysExample.scala b/examples/src/main/scala/com/eff3ct/criteria4s/examples/ArraysExample.scala index c780d7a..3dcdf6a 100644 --- a/examples/src/main/scala/com/eff3ct/criteria4s/examples/ArraysExample.scala +++ b/examples/src/main/scala/com/eff3ct/criteria4s/examples/ArraysExample.scala @@ -1,3 +1,27 @@ +/* + * MIT License + * + * Copyright (c) 2024 Rafael Fernandez + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.eff3ct.criteria4s.examples import com.eff3ct.criteria4s.core._ diff --git a/examples/src/main/scala/com/eff3ct/criteria4s/examples/BetweenExample.scala b/examples/src/main/scala/com/eff3ct/criteria4s/examples/BetweenExample.scala index 3af654d..70c09bf 100644 --- a/examples/src/main/scala/com/eff3ct/criteria4s/examples/BetweenExample.scala +++ b/examples/src/main/scala/com/eff3ct/criteria4s/examples/BetweenExample.scala @@ -1,3 +1,27 @@ +/* + * MIT License + * + * Copyright (c) 2024 Rafael Fernandez + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.eff3ct.criteria4s.examples import com.eff3ct.criteria4s.core._ diff --git a/examples/src/main/scala/com/eff3ct/criteria4s/examples/Example.scala b/examples/src/main/scala/com/eff3ct/criteria4s/examples/Example.scala index 371d17a..869a031 100644 --- a/examples/src/main/scala/com/eff3ct/criteria4s/examples/Example.scala +++ b/examples/src/main/scala/com/eff3ct/criteria4s/examples/Example.scala @@ -1,3 +1,27 @@ +/* + * MIT License + * + * Copyright (c) 2024 Rafael Fernandez + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.eff3ct.criteria4s.examples import com.eff3ct.criteria4s.core._ diff --git a/examples/src/main/scala/com/eff3ct/criteria4s/examples/Example2.scala b/examples/src/main/scala/com/eff3ct/criteria4s/examples/Example2.scala index 87853b4..c117e82 100644 --- a/examples/src/main/scala/com/eff3ct/criteria4s/examples/Example2.scala +++ b/examples/src/main/scala/com/eff3ct/criteria4s/examples/Example2.scala @@ -1,3 +1,27 @@ +/* + * MIT License + * + * Copyright (c) 2024 Rafael Fernandez + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.eff3ct.criteria4s.examples import com.eff3ct.criteria4s.core._ diff --git a/examples/src/main/scala/com/eff3ct/criteria4s/examples/Example3.scala b/examples/src/main/scala/com/eff3ct/criteria4s/examples/Example3.scala index f66bc57..de70dec 100644 --- a/examples/src/main/scala/com/eff3ct/criteria4s/examples/Example3.scala +++ b/examples/src/main/scala/com/eff3ct/criteria4s/examples/Example3.scala @@ -1,3 +1,27 @@ +/* + * MIT License + * + * Copyright (c) 2024 Rafael Fernandez + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.eff3ct.criteria4s.examples import com.eff3ct.criteria4s.core._ diff --git a/examples/src/main/scala/com/eff3ct/criteria4s/examples/Example4.scala b/examples/src/main/scala/com/eff3ct/criteria4s/examples/Example4.scala index a9a7db0..990eece 100644 --- a/examples/src/main/scala/com/eff3ct/criteria4s/examples/Example4.scala +++ b/examples/src/main/scala/com/eff3ct/criteria4s/examples/Example4.scala @@ -1,3 +1,27 @@ +/* + * MIT License + * + * Copyright (c) 2024 Rafael Fernandez + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.eff3ct.criteria4s.examples import com.eff3ct.criteria4s.core._ diff --git a/examples/src/main/scala/com/eff3ct/criteria4s/examples/FilterByUserExample.scala b/examples/src/main/scala/com/eff3ct/criteria4s/examples/FilterByUserExample.scala index cdc61e1..ae23fd4 100644 --- a/examples/src/main/scala/com/eff3ct/criteria4s/examples/FilterByUserExample.scala +++ b/examples/src/main/scala/com/eff3ct/criteria4s/examples/FilterByUserExample.scala @@ -1,3 +1,27 @@ +/* + * MIT License + * + * Copyright (c) 2024 Rafael Fernandez + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.eff3ct.criteria4s.examples import com.eff3ct.criteria4s.core._ diff --git a/examples/src/main/scala/com/eff3ct/criteria4s/examples/NotExample.scala b/examples/src/main/scala/com/eff3ct/criteria4s/examples/NotExample.scala index 80b24c1..b1c5f43 100644 --- a/examples/src/main/scala/com/eff3ct/criteria4s/examples/NotExample.scala +++ b/examples/src/main/scala/com/eff3ct/criteria4s/examples/NotExample.scala @@ -1,3 +1,27 @@ +/* + * MIT License + * + * Copyright (c) 2024 Rafael Fernandez + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.eff3ct.criteria4s.examples import com.eff3ct.criteria4s.core._ diff --git a/examples/src/main/scala/com/eff3ct/criteria4s/examples/datastores/MySQL.scala b/examples/src/main/scala/com/eff3ct/criteria4s/examples/datastores/MySQL.scala index c056750..7b0eb13 100644 --- a/examples/src/main/scala/com/eff3ct/criteria4s/examples/datastores/MySQL.scala +++ b/examples/src/main/scala/com/eff3ct/criteria4s/examples/datastores/MySQL.scala @@ -1,3 +1,27 @@ +/* + * MIT License + * + * Copyright (c) 2024 Rafael Fernandez + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.eff3ct.criteria4s.examples.datastores import com.eff3ct.criteria4s.core.PredicateBinary._ diff --git a/examples/src/main/scala/com/eff3ct/criteria4s/examples/datastores/Postgres.scala b/examples/src/main/scala/com/eff3ct/criteria4s/examples/datastores/Postgres.scala index 8c0d2bf..7bb78fb 100644 --- a/examples/src/main/scala/com/eff3ct/criteria4s/examples/datastores/Postgres.scala +++ b/examples/src/main/scala/com/eff3ct/criteria4s/examples/datastores/Postgres.scala @@ -1,3 +1,27 @@ +/* + * MIT License + * + * Copyright (c) 2024 Rafael Fernandez + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.eff3ct.criteria4s.examples.datastores import com.eff3ct.criteria4s.core.{Column, Show} diff --git a/examples/src/main/scala/com/eff3ct/criteria4s/examples/datastores/WeirdDatastore.scala b/examples/src/main/scala/com/eff3ct/criteria4s/examples/datastores/WeirdDatastore.scala index fd386ab..abd1552 100644 --- a/examples/src/main/scala/com/eff3ct/criteria4s/examples/datastores/WeirdDatastore.scala +++ b/examples/src/main/scala/com/eff3ct/criteria4s/examples/datastores/WeirdDatastore.scala @@ -1,3 +1,27 @@ +/* + * MIT License + * + * Copyright (c) 2024 Rafael Fernandez + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.eff3ct.criteria4s.examples.datastores import com.eff3ct.criteria4s.core._ diff --git a/mongodb/src/main/scala/com/eff3ct/criteria4s/dialect/mongodb/MongoDB.scala b/mongodb/src/main/scala/com/eff3ct/criteria4s/dialect/mongodb/MongoDB.scala index f05f530..5b8f873 100644 --- a/mongodb/src/main/scala/com/eff3ct/criteria4s/dialect/mongodb/MongoDB.scala +++ b/mongodb/src/main/scala/com/eff3ct/criteria4s/dialect/mongodb/MongoDB.scala @@ -1,3 +1,27 @@ +/* + * MIT License + * + * Copyright (c) 2024 Rafael Fernandez + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.eff3ct.criteria4s.dialect.mongodb import com.eff3ct.criteria4s.core._ diff --git a/mongodb/src/main/scala/com/eff3ct/criteria4s/dialect/mongodb/package.scala b/mongodb/src/main/scala/com/eff3ct/criteria4s/dialect/mongodb/package.scala index de01f6b..60e60d2 100644 --- a/mongodb/src/main/scala/com/eff3ct/criteria4s/dialect/mongodb/package.scala +++ b/mongodb/src/main/scala/com/eff3ct/criteria4s/dialect/mongodb/package.scala @@ -1,3 +1,27 @@ +/* + * MIT License + * + * Copyright (c) 2024 Rafael Fernandez + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.eff3ct.criteria4s.dialect package object mongodb extends MongoDB.MongoDBExpr[MongoDB] { diff --git a/project/Build.scala b/project/Build.scala index 753ee4c..f0e8b73 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -43,12 +43,12 @@ object Build extends AutoPlugin { headerLicense := Some(headerIOLicense), ThisBuild / scalacOptions ++= Vector( "-release:8", - "-deprecation", // Emit warning and location for usages of deprecated APIs. - "-encoding", + "-deprecation", // Emit warnings for deprecated APIs + "-feature", // Warn about features that should be imported explicitly + "-encoding", "UTF-8", // Specify encoding for source files + "-Xlint" , // Enable recommended additional warnings "-Ymacro-annotations", - "utf-8", // Specify character encoding used by source files. "-explaintypes", // Explain type errors in more detail. - "-feature", // Emit warning and location for usages of features that should be imported explicitly. "-language:existentials", // Existential types (besides wildcard types) can be written and inferred "-language:experimental.macros", // Allow macro definition (besides implementation and application) "-language:higherKinds", // Allow higher-kinded types diff --git a/sql/src/main/scala/com/eff3ct/criteria4s/dialect/sql/SQL.scala b/sql/src/main/scala/com/eff3ct/criteria4s/dialect/sql/SQL.scala index 509dd06..2a71b45 100644 --- a/sql/src/main/scala/com/eff3ct/criteria4s/dialect/sql/SQL.scala +++ b/sql/src/main/scala/com/eff3ct/criteria4s/dialect/sql/SQL.scala @@ -1,3 +1,27 @@ +/* + * MIT License + * + * Copyright (c) 2024 Rafael Fernandez + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.eff3ct.criteria4s.dialect.sql import com.eff3ct.criteria4s.core._ diff --git a/sql/src/main/scala/com/eff3ct/criteria4s/dialect/sql/package.scala b/sql/src/main/scala/com/eff3ct/criteria4s/dialect/sql/package.scala index a57b975..810de05 100644 --- a/sql/src/main/scala/com/eff3ct/criteria4s/dialect/sql/package.scala +++ b/sql/src/main/scala/com/eff3ct/criteria4s/dialect/sql/package.scala @@ -1,3 +1,27 @@ +/* + * MIT License + * + * Copyright (c) 2024 Rafael Fernandez + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.eff3ct.criteria4s.dialect package object sql extends SQL.SQLExpr[SQL] {