Skip to content

Commit fcfec6c

Browse files
authored
Merge pull request #1933 from jdaugherty/newMongoMerge
Merge Mongodb & Hibernate5
2 parents 4da6693 + 89560ea commit fcfec6c

File tree

1,631 files changed

+204187
-2087
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,631 files changed

+204187
-2087
lines changed

.github/workflows/gradle.yml

Lines changed: 63 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,70 @@ on:
66
pull_request:
77
branches:
88
- '[7-9]+.[0-9]+.x'
9+
permissions:
10+
contents: read
11+
packages: read
912
jobs:
10-
build:
11-
name: "Build Project"
13+
datastore-build:
14+
name: "Build Datastore Project"
15+
runs-on: ubuntu-24.04
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
java: [ 17, 21 ]
20+
steps:
21+
- name: "📥 Checkout the repository"
22+
uses: actions/checkout@v4
23+
- name: "☕️ Setup JDK"
24+
uses: actions/setup-java@v4
25+
with:
26+
java-version: ${{ matrix.java }}
27+
distribution: liberica
28+
- name: "🐘 Setup Gradle"
29+
uses: gradle/actions/setup-gradle@v4
30+
with:
31+
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
32+
- name: "🔨 Run Build"
33+
id: build
34+
env:
35+
GITHUB_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
36+
run: ./gradlew cleanTest build --continue -PonlyDatastoreTests
37+
mongodb-build:
38+
name: "Build Mongodb Project"
39+
runs-on: ubuntu-24.04
40+
strategy:
41+
fail-fast: false
42+
matrix:
43+
java: [ 17, 21 ]
44+
mongodb-version: [ '4', '5', '6', '7', '8' ]
45+
steps:
46+
- name: "📥 Checkout the repository"
47+
uses: actions/checkout@v4
48+
- name: "☕️ Setup JDK"
49+
uses: actions/setup-java@v4
50+
with:
51+
java-version: ${{ matrix.java }}
52+
distribution: liberica
53+
- name: "🐘 Setup Gradle"
54+
uses: gradle/actions/setup-gradle@v4
55+
with:
56+
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
57+
- name: "▶️ Start MongoDB (needed for some tests)"
58+
uses: supercharge/mongodb-github-action@90004df786821b6308fb02299e5835d0dae05d0d # v1.12.0 (Use commit sha as this is a 3rd party action)
59+
with:
60+
mongodb-version: ${{ matrix.mongodb-version }}
61+
- name: "🔨 Run Build"
62+
id: build
63+
env:
64+
GITHUB_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
65+
run: ./gradlew cleanTest build --continue -PonlyMongodbTests
66+
hibernate5-build:
67+
name: "Build Hibernate5 Project"
1268
runs-on: ubuntu-24.04
13-
permissions:
14-
contents: read
15-
packages: read
1669
strategy:
1770
fail-fast: false
1871
matrix:
19-
java: [17, 21]
72+
java: [ 17, 21 ]
2073
steps:
2174
- name: "📥 Checkout the repository"
2275
uses: actions/checkout@v4
@@ -33,15 +86,12 @@ jobs:
3386
id: build
3487
env:
3588
GITHUB_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
36-
run: ./gradlew build --continue
89+
run: ./gradlew cleanTest build --continue -PonlyHibernate5Tests
3790
publish:
3891
if: github.event_name == 'push'
3992
name: "Publish Snapshot"
40-
needs: build
93+
needs: [datastore-build, hibernate5-build, mongodb-build]
4194
runs-on: ubuntu-24.04
42-
permissions:
43-
contents: read
44-
packages: read
4595
steps:
4696
- name: "📥 Checkout the repository"
4797
uses: actions/checkout@v4
@@ -68,8 +118,7 @@ jobs:
68118
needs: publish
69119
runs-on: ubuntu-24.04
70120
permissions:
71-
contents: write
72-
packages: read
121+
contents: write # so gh-pages can be updated
73122
steps:
74123
- name: "📥 Checkout the repository"
75124
uses: actions/checkout@v4
@@ -97,7 +146,7 @@ jobs:
97146
trigger-build-gorm-impls:
98147
if: github.event_name == 'push'
99148
name: "Trigger Build in GORM Implementations"
100-
needs: [build, publish]
149+
needs: [publish]
101150
runs-on: ubuntu-24.04
102151
continue-on-error: true
103152
steps:
@@ -111,37 +160,11 @@ jobs:
111160
- name: "📝 Create Snapshot Message for the Workflow Dispatch"
112161
id: dispatch_message
113162
run: echo "value={\"message\":\"New Data Mapping Snapshots $(date) - $GITHUB_SHA\"}" >> $GITHUB_OUTPUT
114-
- name: "📡 Invoke the Java CI workflow in GORM Hibernate5"
115-
uses: benc-uk/workflow-dispatch@e2e5e9a103e331dad343f381a29e654aea3cf8fc # v1.2.4 (Use commit sha as this is a 3rd party action)
116-
continue-on-error: true
117-
with:
118-
workflow: Java CI
119-
repo: grails/gorm-hibernate5
120-
ref: ${{ steps.extract_branch.outputs.value }}
121-
token: ${{ secrets.GH_TOKEN }}
122163
- name: "📡 Invoke the Java CI workflow in GORM Hibernate6"
123164
continue-on-error: true
124165
uses: benc-uk/workflow-dispatch@e2e5e9a103e331dad343f381a29e654aea3cf8fc # v1.2.4 (Use commit sha as this is a 3rd party action)
125166
with:
126167
workflow: Java CI
127168
repo: grails/gorm-hibernate6
128169
ref: ${{ steps.extract_branch.outputs.value }}
129-
token: ${{ secrets.GH_TOKEN }}
130-
- name: "📡 Invoke the Java CI workflow in GORM MongoDB"
131-
continue-on-error: true
132-
uses: benc-uk/workflow-dispatch@e2e5e9a103e331dad343f381a29e654aea3cf8fc # v1.2.4 (Use commit sha as this is a 3rd party action)
133-
with:
134-
workflow: Java CI
135-
repo: grails/gorm-mongodb
136-
ref: ${{ steps.extract_branch.outputs.value }}
137-
token: ${{ secrets.GH_TOKEN }}
138-
inputs: ${{ steps.dispatch_message.outputs.value }}
139-
- name: "📡 Invoke the Java CI workflow in GORM Neo4j"
140-
if: false # Skip until neo4j is ported to grails 7
141-
continue-on-error: true
142-
uses: benc-uk/workflow-dispatch@e2e5e9a103e331dad343f381a29e654aea3cf8fc # v1.2.4 (Use commit sha as this is a 3rd party action)
143-
with:
144-
workflow: Java CI
145-
repo: grails/gorm-neo4j
146-
ref: ${{ steps.extract_branch.outputs.value }}
147170
token: ${{ secrets.GH_TOKEN }}

.github/workflows/groovy-joint-workflow.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,10 @@ jobs:
127127
key: cache-local-maven-${{ github.sha }}
128128
- name: "🪶 Add mavenLocal repository to build"
129129
run: sed -i 's|// mavenLocal() // Keep|mavenLocal() // Keep|' build.gradle
130+
- name: "▶️ Start MongoDB (needed for some tests)"
131+
uses: supercharge/mongodb-github-action@90004df786821b6308fb02299e5835d0dae05d0d # v1.12.0 (Use commit sha as this is a 3rd party action)
132+
with:
133+
mongodb-version: '8'
130134
- name: "🔨 Build and test the project using the locally built Groovy snapshot"
131135
env:
132136
GITHUB_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,33 @@
1+
!gradle-wrapper.jar
2+
*.db
3+
*.iml
4+
*.ipr
5+
*.iws
6+
*.sha1
17
*.swp
2-
.settings/
8+
*.zip
9+
.DS_Store
310
.classpath
4-
.project
11+
.gradle
12+
.gradletasknamecache
13+
.idea
514
.metadata
6-
.DS_Store
15+
.project
16+
.settings/
17+
Servers/
18+
bin/
719
build/
8-
target/
9-
.gradle/
10-
grails-plugins/mongodb/web-app
20+
classes/
21+
eclipse-workspace/
22+
gradle-app.setting
1123
grails-plugins/checkout
12-
grails-plugins/redis/web-app
24+
grails-plugins/mongodb/grails-mongodb-1.0.0.RC5.zip.sha1
25+
grails-plugins/mongodb/web-app
1326
grails-plugins/neo4j/web-app
14-
eclipse-workspace/
15-
Servers/
27+
grails-plugins/redis/web-app
1628
out
17-
stacktrace.log
18-
*.iws
19-
*.iml
20-
*.ipr
21-
.idea/*
22-
classes/*
23-
bin/
24-
boot-plugins/*/.idea/*
25-
grails-plugins/mongodb/grails-mongodb-1.0.0.RC5.zip.sha1
29+
prodDb.mv.db
30+
secring.gpg
2631
spy.log
27-
*.db
28-
29-
*.sha1
30-
31-
*.zip
32+
stacktrace.log
33+
target/

DEVELOPMENT.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Various properties that control which tests run
2+
* onlyHibernate5Tests
3+
* onlyMongodbTests
4+
* onlyDatastoreTests
5+
* skipHibernate5Tests
6+
* skipMongodbTests
7+
* skipDatastoreTests
8+
9+
# Start a mongo docker container
10+
docker run -d --name mongo-on-docker -p 27017:27017 mongo

build.gradle

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,33 @@ version = projectVersion
5454
group = 'this.will.be.overridden'
5555

5656
def publishedProjects = [
57+
// datastore
5758
'grails-datastore-async',
5859
'grails-datastore-core',
5960
'grails-datastore-gorm',
6061
'grails-datastore-gorm-async',
6162
//'grails-datastore-gorm-rx',
6263
'grails-datastore-gorm-support',
6364
'grails-datastore-gorm-tck',
64-
'grails-datastore-gorm-test',
65+
'grails-datastore-gorm-tck-base',
66+
'grails-datastore-gorm-tck-domains',
6567
'grails-datastore-gorm-validation',
6668
'grails-datastore-web',
6769
'grails-gorm-testing-support',
70+
// simple
71+
'simple-gorm',
72+
// hibernate5
73+
'hibernate5-boot-plugin',
74+
'hibernate5-database-migration',
75+
'hibernate5-gorm',
76+
'hibernate5-grails-plugin',
77+
// mongodb
78+
'mongodb-boot-plugin',
79+
'mongodb-gorm',
80+
'mongodb-gorm-bson',
81+
'mongodb-gorm-ext',
82+
'mongodb-grails-plugin',
83+
'mongodb-views-json-templates'
6884
]
6985
subprojects {
7086
if (name in publishedProjects) {
@@ -73,4 +89,4 @@ subprojects {
7389
}
7490
}
7591

76-
apply from: layout.projectDirectory.file('gradle/documentation-config.gradle')
92+
apply from: layout.projectDirectory.file('gradle/documentation-config.gradle')

buildSrc/build.gradle

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ file('../gradle.properties').withInputStream {
88
}
99

1010
repositories {
11-
mavenLocal()
11+
// mavenLocal()
1212
maven { url = 'https://repo.grails.org/grails/core' }
1313
mavenCentral()
1414
if (System.getenv('GITHUB_MAVEN_PASSWORD')) {
@@ -25,5 +25,7 @@ repositories {
2525
dependencies {
2626
implementation platform("org.grails:grails-bom:${versions.getProperty('grailsVersion')}")
2727
implementation 'org.grails:grails-gradle-plugin'
28-
runtimeOnly 'io.github.gradle-nexus:publish-plugin:2.0.0'
28+
implementation 'com.bertramlabs.plugins:asset-pipeline-gradle'
29+
implementation 'org.grails.plugins:views-gradle'
30+
implementation 'org.springframework.boot:spring-boot-gradle-plugin'
2931
}

docs/data-mapping-website/src/main/resources/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ <h2 class='icon icon-lab'>Socialize</h2>
8282
<div class='navbar-collapse collapse'>
8383
<ul class='nav navbar-nav navbar-right'>
8484
<li class=''><a href='whatsNew/manual/index.html'>What's New?</a></li>
85-
<li class=''><a href='hibernate/manual/index.html'>Documentation</a></li>
86-
<li class=''><a href='hibernate/api/index.html'>Core API</a></li>
85+
<li class=''><a href='hibernate5/manual/index.html'>Documentation</a></li>
86+
<li class=''><a href='hibernate5/api/index.html'>Core API</a></li>
8787
<li class=''><a href='developer/manual/index.html'>Developer Guide</a></li>
8888
<li class=''><a href='https://grails.org/support.html'>Support</a></li>
8989
<li>
@@ -114,7 +114,7 @@ <h1>Hibernate</h1>
114114
<p>The original implementation of GORM, GORM for Hibernate provides all the goodness of GORM for SQL databases.
115115

116116
</p>
117-
<p>- <a href="hibernate/manual/index.html">Documentation</a> - <a href="hibernate/api/index.html">API</a> - <a href="https://github.com/grails/gorm-hibernate5">Source</a>
117+
<p>- <a href="hibernate5/manual/index.html">Documentation</a> - <a href="hibernate5/api/index.html">API</a> - <a href="https://github.com/grails/gorm-hibernate5">Source</a>
118118

119119
</p>
120120
</article>

docs/guide-rx/src/main/docs/gettingStarted/CRUD.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Book.get(id)
6060
}
6161
----
6262

63-
The `switchMap` transforms an `Observable` and converts the result into another `Observable`. However, this is not the most efficient way to perform updates as you can use https://gorm.grails.org/latest/hibernate/manual/index.html#whereQueries[where queries] to update an instance without retrieving it:
63+
The `switchMap` transforms an `Observable` and converts the result into another `Observable`. However, this is not the most efficient way to perform updates as you can use https://gorm.grails.org/latest/hibernate5/manual/index.html#whereQueries[where queries] to update an instance without retrieving it:
6464

6565

6666
[source,groovy]

docs/guide-rx/src/main/docs/querying/dynamicFinders.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
=== Dynamic Finders
2-
Although _Where queries_ are preferred, _Dynamic finders_ are another option for simple queries and are also very expressive. The https://gorm.grails.org/latest/hibernate/manual/index.html#finders[syntax for Dynamic finders is described in the GORM user guide]. The major difference in RxGORM is that all dynamic finders return an `rx.Observable`:
2+
Although _Where queries_ are preferred, _Dynamic finders_ are another option for simple queries and are also very expressive. The https://gorm.grails.org/latest/hibernate5/manual/index.html#finders[syntax for Dynamic finders is described in the GORM user guide]. The major difference in RxGORM is that all dynamic finders return an `rx.Observable`:
33

44
[source,groovy]
55
----

docs/guide-rx/src/main/docs/querying/index.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
== Querying
22
RxGORM supports all the typical ways of querying that you are used to with GORM including:
33

4-
* https://gorm.grails.org/latest/hibernate/manual/index.html#finders[Dynamic finders]
5-
* https://gorm.grails.org/latest/hibernate/manual/index.html#whereQueries[Where queries]
6-
* https://gorm.grails.org/latest/hibernate/manual/index.html#detachedCriteria[Detached Criteria]
7-
* https://gorm.grails.org/latest/hibernate/manual/index.html#criteria[Criteria queries]
4+
* https://gorm.grails.org/latest/hibernate5/manual/index.html#finders[Dynamic finders]
5+
* https://gorm.grails.org/latest/hibernate5/manual/index.html#whereQueries[Where queries]
6+
* https://gorm.grails.org/latest/hibernate5/manual/index.html#detachedCriteria[Detached Criteria]
7+
* https://gorm.grails.org/latest/hibernate5/manual/index.html#criteria[Criteria queries]
88
99
The major difference is that all query operations return an `Observable`. In this section we will go through the various ways you can query for GORM objects.
1010

0 commit comments

Comments
 (0)