Skip to content

Commit bcbbc6c

Browse files
Merge pull request #69 from dynamiatools/feature/saas-account-migration
Feature/saas account migration
2 parents 5991af3 + c377b05 commit bcbbc6c

46 files changed

Lines changed: 5321 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/*
2+
* Copyright (C) 2023 Dynamia Soluciones IT S.A.S - NIT 900302344-1
3+
* Colombia / South America
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
package tools.dynamia.modules.saas.api;
18+
19+
import java.lang.annotation.Documented;
20+
import java.lang.annotation.ElementType;
21+
import java.lang.annotation.Retention;
22+
import java.lang.annotation.RetentionPolicy;
23+
import java.lang.annotation.Target;
24+
25+
/**
26+
* Marks a JPA {@code @Entity} class to be completely excluded from the Tenant Mobility
27+
* export/import/clone pipeline.
28+
*
29+
* <p>Apply this annotation to entities that contain ephemeral, audit, cache or metric data
30+
* that should never travel with a tenant:
31+
*
32+
* <pre>{@code
33+
* @Entity
34+
* @AccountExportIgnore
35+
* public class LoginAuditLog extends SimpleEntitySaaS {
36+
* ...
37+
* }
38+
* }</pre>
39+
*
40+
* <p>Entities annotated with {@code @AccountExportIgnore} are silently skipped during
41+
* discovery, so they will never appear in an export file and will never be processed
42+
* on import.
43+
*
44+
* @author Mario Serrano Leones
45+
* @see ExportIgnore
46+
*/
47+
@Documented
48+
@Retention(RetentionPolicy.RUNTIME)
49+
@Target(ElementType.TYPE)
50+
public @interface AccountExportIgnore {
51+
}
52+
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/*
2+
* Copyright (C) 2023 Dynamia Soluciones IT S.A.S - NIT 900302344-1
3+
* Colombia / South America
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
package tools.dynamia.modules.saas.api;
18+
19+
import java.lang.annotation.Documented;
20+
import java.lang.annotation.ElementType;
21+
import java.lang.annotation.Retention;
22+
import java.lang.annotation.RetentionPolicy;
23+
import java.lang.annotation.Target;
24+
25+
/**
26+
* Marks a specific field in a JPA entity to be excluded from Tenant Mobility
27+
* serialization during export.
28+
*
29+
* <p>Use this for fields that are computed, cached, or otherwise should not be
30+
* persisted to a different environment:
31+
*
32+
* <pre>{@code
33+
* @Entity
34+
* public class Customer extends SimpleEntitySaaS {
35+
*
36+
* private String name;
37+
*
38+
* @ExportIgnore
39+
* private transient String cachedFullName; // computed
40+
*
41+
* @ExportIgnore
42+
* private String internalToken; // environment-specific secret
43+
* }
44+
* }</pre>
45+
*
46+
* <p>Fields with this annotation are silently skipped during entity serialization.
47+
* On import, those fields will retain their default (null / primitive default) values.
48+
*
49+
* @author Mario Serrano Leones
50+
* @see AccountExportIgnore
51+
*/
52+
@Documented
53+
@Retention(RetentionPolicy.RUNTIME)
54+
@Target(ElementType.FIELD)
55+
public @interface ExportIgnore {
56+
}
57+

0 commit comments

Comments
 (0)