| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
|
| 17 | |
package org.kuali.rice.core.database.platform; |
| 18 | |
|
| 19 | |
import java.util.regex.Pattern; |
| 20 | |
|
| 21 | |
import javax.persistence.EntityManager; |
| 22 | |
|
| 23 | |
import org.apache.ojb.broker.PersistenceBroker; |
| 24 | |
import org.apache.ojb.broker.query.Criteria; |
| 25 | |
|
| 26 | |
|
| 27 | |
|
| 28 | |
|
| 29 | |
|
| 30 | 0 | public class DerbyDatabasePlatform extends ANSISqlDatabasePlatform { |
| 31 | |
|
| 32 | 0 | private static final Pattern APOS_PAT = Pattern.compile("'"); |
| 33 | |
|
| 34 | |
public String getLockRouteHeaderQuerySQL(Long routeHeaderId, boolean wait) { |
| 35 | 0 | return "SELECT DOC_HDR_ID FROM KREW_DOC_HDR_T WHERE DOC_HDR_ID=?"; |
| 36 | |
} |
| 37 | |
|
| 38 | 0 | private static long nextVal = 1000; |
| 39 | |
|
| 40 | |
public String getCurTimeFunction() { |
| 41 | 0 | return "CURRENT_TIMESTAMP"; |
| 42 | |
} |
| 43 | |
|
| 44 | |
public String getDateFormatString(String dateFormatString) { |
| 45 | 0 | return "'" + dateFormatString + "'"; |
| 46 | |
} |
| 47 | |
|
| 48 | |
public String getStrToDateFunction() { |
| 49 | 0 | return null; |
| 50 | |
} |
| 51 | |
|
| 52 | |
public Long getNextValSQL(String sequenceName, PersistenceBroker persistenceBroker) { |
| 53 | 0 | return nextVal++; |
| 54 | |
} |
| 55 | |
|
| 56 | |
public String toString() { |
| 57 | 0 | return "[Derby]"; |
| 58 | |
} |
| 59 | |
|
| 60 | |
public Long getNextValSQL(String sequenceName, EntityManager entityManger) { |
| 61 | 0 | return nextVal++; |
| 62 | |
} |
| 63 | |
|
| 64 | |
public String getSelectForUpdateSuffix(long waitMillis) { |
| 65 | 0 | throw new UnsupportedOperationException("Implement me!"); |
| 66 | |
} |
| 67 | |
|
| 68 | |
|
| 69 | |
|
| 70 | |
|
| 71 | |
|
| 72 | |
|
| 73 | |
public String escapeString(String sqlString) { |
| 74 | 0 | return (sqlString != null) ? APOS_PAT.matcher(sqlString).replaceAll("''") : null; |
| 75 | |
} |
| 76 | |
|
| 77 | |
public void applyLimit(Integer limit, Criteria criteria) { |
| 78 | |
|
| 79 | 0 | } |
| 80 | |
} |