* Add support for ID generation using PostgreSQL sequence syntax
This commit is contained in:
parent
1213c464e3
commit
7c658fa9db
1 changed files with 10 additions and 3 deletions
|
@ -825,9 +825,16 @@ public final class NodeManager {
|
||||||
Statement stmt = null;
|
Statement stmt = null;
|
||||||
String retval = null;
|
String retval = null;
|
||||||
long logTimeStart = logSql ? System.currentTimeMillis() : 0;
|
long logTimeStart = logSql ? System.currentTimeMillis() : 0;
|
||||||
String q = new StringBuffer("SELECT ").append(map.getIDgen())
|
String q;
|
||||||
.append(".nextval FROM dual").toString();
|
if (map.isOracle()) {
|
||||||
|
q = new StringBuffer("SELECT ").append(map.getIDgen())
|
||||||
|
.append(".nextval FROM dual").toString();
|
||||||
|
} else if (map.isPostgreSQL()) {
|
||||||
|
q = new StringBuffer("SELECT nextval('")
|
||||||
|
.append(map.getIDgen()).append("')").toString();
|
||||||
|
} else {
|
||||||
|
throw new RuntimeException("Unable to generate sequence: unknown DB");
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Connection con = map.getConnection();
|
Connection con = map.getConnection();
|
||||||
|
|
Loading…
Add table
Reference in a new issue