-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
95 additions
and
2 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
documentation/user/en/use/api/example/imperative-schema-definition.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
@Data | ||
public class MyEntity { | ||
|
||
// contains id of parent entity, or null if this entity is a root entity | ||
@ParentEntity | ||
@Nullable private final Integer parentId(), | ||
|
||
// contains parent entity, or null if this entity is a root entity | ||
@ParentEntity | ||
@Nullable private final SealedEntity parentEntity(), | ||
|
||
// contains reference to a parent entity, or null if this entity is a root entity | ||
@ParentEntity | ||
@Nullable private final EntityReference parentEntityReference(), | ||
|
||
// contains reference to a parent wrapped in this interface, or null if this entity is a root entity | ||
@ParentEntity | ||
@Nullable private final MyEntity parentMyEntity() | ||
|
||
} |
35 changes: 35 additions & 0 deletions
35
documentation/user/en/use/api/example/parent-interface.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
public interface MyEntity { | ||
|
||
// return id of parent entity, or null if this entity is a root entity | ||
@ParentEntity | ||
@Nullable Integer getParentId(); | ||
|
||
// return optional id of parent entity, or empty if this entity is a root entity | ||
@ParentEntity | ||
@Nonnull OptionalInt getParentIdIfNotRoot(); | ||
|
||
// return parent entity, or null if this entity is a root entity | ||
@ParentEntity | ||
@Nullable SealedEntity getParentEntity(); | ||
|
||
// return optional parent entity, or empty if this entity is a root entity | ||
@ParentEntity | ||
@Nonnull Optional<SealedEntity> getParentEntityIfNotRoot(); | ||
|
||
// return reference to a parent entity, or null if this entity is a root entity | ||
@ParentEntity | ||
@Nullable EntityReference getParentEntityReference(); | ||
|
||
// return optional reference to a parent entity, or empty if this entity is a root entity | ||
@ParentEntity | ||
@Nonnull Optional<EntityReference> getParentEntityReferenceIfPresent(); | ||
|
||
// return reference to a parent wrapped in this interface, or null if this entity is a root entity | ||
@ParentEntity | ||
@Nullable MyEntity getParentMyEntity(); | ||
|
||
// return optional reference to a parent wrapped in this interface, or empty if this entity is a root entity | ||
@ParentEntity | ||
@Nonnull Optional<MyEntity> getParentMyEntityIfPresent(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
public record MyEntity( | ||
// contains id of parent entity, or null if this entity is a root entity | ||
@ParentEntity | ||
@Nullable Integer parentId(), | ||
|
||
// contains parent entity, or null if this entity is a root entity | ||
@ParentEntity | ||
@Nullable SealedEntity parentEntity(), | ||
|
||
// contains reference to a parent entity, or null if this entity is a root entity | ||
@ParentEntity | ||
@Nullable EntityReference parentEntityReference(), | ||
|
||
// contains reference to a parent wrapped in this interface, or null if this entity is a root entity | ||
@ParentEntity | ||
@Nullable MyEntity parentMyEntity() | ||
) { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters