-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #155 from NitorCreations/oracle-support
initial oracle ddl and configuration
- Loading branch information
Showing
12 changed files
with
316 additions
and
15 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
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
79 changes: 79 additions & 0 deletions
79
...java/com/nitorcreations/nflow/engine/internal/storage/db/OracleDatabaseConfiguration.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,79 @@ | ||
package com.nitorcreations.nflow.engine.internal.storage.db; | ||
|
||
import java.sql.Types; | ||
|
||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.annotation.Profile; | ||
|
||
import com.nitorcreations.nflow.engine.workflow.instance.WorkflowInstance.WorkflowInstanceStatus; | ||
|
||
@Profile("nflow.db.oracle") | ||
@Configuration | ||
public class OracleDatabaseConfiguration extends DatabaseConfiguration { | ||
|
||
public OracleDatabaseConfiguration() { | ||
super("oracle"); | ||
} | ||
|
||
@Bean | ||
public SQLVariants sqlVariants() { | ||
return new OracleSqlVariants(); | ||
} | ||
|
||
public static class OracleSqlVariants implements SQLVariants { | ||
|
||
@Override | ||
public String currentTimePlusSeconds(int seconds) { | ||
return "current_timestamp + interval '" + seconds + "' second"; | ||
} | ||
|
||
@Override | ||
public boolean hasUpdateReturning() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean hasUpdateableCTE() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public String nextActivationUpdate() { | ||
return "(case " | ||
+ "when ? is null then null " | ||
+ "when external_next_activation is null then ? " | ||
+ "else least(?, external_next_activation) end)"; | ||
} | ||
|
||
@Override | ||
public String workflowStatus(WorkflowInstanceStatus status) { | ||
return "'" + status.name() + "'"; | ||
} | ||
|
||
@Override | ||
public String workflowStatus() { | ||
return "?"; | ||
} | ||
|
||
@Override | ||
public String actionType() { | ||
return "?"; | ||
} | ||
|
||
@Override | ||
public String castToText() { | ||
return ""; | ||
} | ||
|
||
@Override | ||
public String limit(String query, String limit) { | ||
return "select * from (" + query + ") where rownum <= " + limit; | ||
} | ||
|
||
@Override | ||
public int longTextType() { | ||
return Types.CLOB; | ||
} | ||
} | ||
} |
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
Oops, something went wrong.