Skip to content

Commit 0d10a0b

Browse files
authored
Merge pull request #520 from cap-java/SDMEXT-discardIssueFix-feature
Fix issue in discarding newly created entities which has multi-level of nested children
2 parents aedf418 + 9491c80 commit 0d10a0b

16 files changed

Lines changed: 322 additions & 51 deletions

File tree

.github/workflows/multiTenancyDeployLocal.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ jobs:
9494
echo "java version:"
9595
java --version
9696
sed -i 's|__REPOSITORY_ID__|${{ steps.set_repository_id.outputs.repository_id }}|g' mta.yaml
97+
sed -i 's|__DATABASE_ID__|${{ secrets.DATABASE_ID }}|g' mta.yaml
9798
mbt build
9899
echo "✅ MBT build completed!"
99100

.github/workflows/multiTenant_deploy_and_Integration_test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ jobs:
6767
echo "java version:"
6868
java --version
6969
sed -i 's|__REPOSITORY_ID__|${{ steps.set_repository_id.outputs.repository_id }}|g' mta.yaml
70+
sed -i 's|__DATABASE_ID__|${{ secrets.DATABASE_ID }}|g' mta.yaml
7071
mbt build
7172
echo "✅ MBT build completed!"
7273

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
sdm/target/
2+
**/target/
23
.flattened-pom.xml
34
node_modules/
5+
**/package-lock.json
6+
**/src/gen/
47

58
# Compiled class file
69
*.class
@@ -22,6 +25,12 @@ node_modules/
2225
*.zip
2326
*.tar.gz
2427
*.rar
28+
*.hdbtable
29+
*.hdbview
30+
*.xml
31+
*.json
32+
*.sql
33+
*.mtar
2534

2635
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
2736
hs_err_pid*

app/multi-tenant/central-space/cloud-cap-samples-java/db/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<dependency>
1717
<groupId>com.sap.cds</groupId>
1818
<artifactId>sdm</artifactId>
19-
<version>1.8.1-SNAPSHOT</version>
19+
<version>1.10.1-SNAPSHOT</version>
2020
</dependency>
2121
</dependencies>
2222

app/multi-tenant/central-space/cloud-cap-samples-java/mta.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ modules:
5252
parameters:
5353
memory: 256M
5454
disk-quota: 1024M
55+
properties:
56+
DATABASE_ID: __DATABASE_ID__ # Placeholder for DATABASE_ID
5557
build-parameters:
5658
builder: custom
5759
build-result: gen
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
const cds = require('@sap/cds');
2+
3+
const LOG = cds.log('server');
4+
5+
cds.once('bootstrap', async (app) => {
6+
const databaseId = process.env.DATABASE_ID;
7+
if (databaseId && databaseId !== 'REPLACE_WITH_YOUR_DATABASE_ID') {
8+
cds.env.requires['cds.xt.DeploymentService'] ??= {};
9+
cds.env.requires['cds.xt.DeploymentService'].hdi ??= {};
10+
cds.env.requires['cds.xt.DeploymentService'].hdi.create ??= {};
11+
cds.env.requires['cds.xt.DeploymentService'].hdi.create.database_id = databaseId;
12+
LOG.info(`Configured HDI database_id from environment`);
13+
} else {
14+
LOG.error(`DATABASE_ID environment variable is not set or is still the placeholder. HDI container creation will fail.`);
15+
}
16+
});
17+
18+
module.exports = cds.server;

app/multi-tenant/central-space/cloud-cap-samples-java/srv/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
<dependency>
4141
<groupId>com.sap.cds</groupId>
4242
<artifactId>sdm</artifactId>
43-
<version>1.8.1-SNAPSHOT</version>
43+
<version>1.10.1-SNAPSHOT</version>
4444
</dependency>
4545
<dependency>
4646
<groupId>com.sap.cds</groupId>

app/multi-tenant/personal-space/cloud-cap-samples-java/mta.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ modules:
5252
parameters:
5353
memory: 256M
5454
disk-quota: 1024M
55+
properties:
56+
DATABASE_ID: __DATABASE_ID__ # Placeholder for DATABASE_ID
5557
build-parameters:
5658
builder: custom
5759
build-result: gen
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
const cds = require('@sap/cds');
2+
3+
const LOG = cds.log('server');
4+
5+
cds.once('bootstrap', async (app) => {
6+
const databaseId = process.env.DATABASE_ID;
7+
if (databaseId && databaseId !== 'REPLACE_WITH_YOUR_DATABASE_ID') {
8+
cds.env.requires['cds.xt.DeploymentService'] ??= {};
9+
cds.env.requires['cds.xt.DeploymentService'].hdi ??= {};
10+
cds.env.requires['cds.xt.DeploymentService'].hdi.create ??= {};
11+
cds.env.requires['cds.xt.DeploymentService'].hdi.create.database_id = databaseId;
12+
LOG.info(`Configured HDI database_id from environment`);
13+
} else {
14+
LOG.error(`DATABASE_ID environment variable is not set or is still the placeholder. HDI container creation will fail.`);
15+
}
16+
});
17+
18+
module.exports = cds.server;

app/single-tenant/central-space/demoapp/db/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<dependency>
1717
<groupId>com.sap.cds</groupId>
1818
<artifactId>sdm</artifactId>
19-
<version>1.8.1-SNAPSHOT</version>
19+
<version>1.10.1-SNAPSHOT</version>
2020
</dependency>
2121
</dependencies>
2222

0 commit comments

Comments
 (0)