This repository has been archived by the owner on Nov 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 303
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
add support for hana as dbType, rewview rework, #671: included review improvement suggestions
- Loading branch information
Showing
6 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
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
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
18 changes: 18 additions & 0 deletions
18
...urces/archetype-resources/core/src/main/resources/db/type/hana/V0001__Create_Sequence.sql
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 @@ | ||
-- Leave a large ID space reserved for master-data and test-data | ||
CREATE SEQUENCE HIBERNATE_SEQUENCE START WITH 1000000; | ||
|
||
-- hana does not support Dateadd function out of the box so we add it here to be able to use it for master-data SQLs | ||
CREATE FUNCTION DATEADD(IN DATETYPE NVARCHAR(256), IN NUMBER INTEGER, IN TS TIMESTAMP) | ||
RETURNS TSADD TIMESTAMP | ||
AS | ||
BEGIN | ||
IF :DATETYPE = 'DAY' | ||
THEN | ||
TSADD = ADD_DAYS(:TS, :NUMBER); | ||
ELSEIF :DATETYPE = 'HOUR' | ||
THEN | ||
TSADD = ADD_SECONDS(:TS, :NUMBER * 3600); | ||
ELSE | ||
SIGNAL SQL_ERROR_CODE 10000 SET MESSAGE_TEXT = 'Unsupported date type: ' || :DATETYPE; | ||
END IF; | ||
END; |
7 changes: 7 additions & 0 deletions
7
...ources/archetype-resources/core/src/main/resources/db/type/hana/V0002__Create_RevInfo.sql
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,7 @@ | ||
-- *** RevInfo (Commit log for envers audit trail) *** | ||
CREATE COLUMN TABLE RevInfo( | ||
id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1), | ||
"timestamp" BIGINT NOT NULL, | ||
userLogin VARCHAR(255), | ||
PRIMARY KEY (ID) | ||
); |
9 changes: 9 additions & 0 deletions
9
...s/archetype-resources/core/src/main/resources/db/type/hana/V0003__Create_BinaryObject.sql
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,9 @@ | ||
-- *** BinaryObject (BLOBs) *** | ||
CREATE COLUMN TABLE BinaryObject ( | ||
id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY, | ||
modificationCounter INTEGER NOT NULL, | ||
content BLOB, | ||
filesize BIGINT NOT NULL, | ||
mimeType VARCHAR(255), | ||
CONSTRAINT PK_BinaryObject_id PRIMARY KEY(ID) | ||
); |