|
|||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | ||||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | ||||||||||
java.lang.Objectorg.apache.slide.store.impl.rdbms.AbstractRDBMSAdapter
org.apache.slide.store.impl.rdbms.StandardRDBMSAdapter
com.isenshi.util.extlib.HSQLDBRDBMSAdapter
RDBMSAdapter for HSQLDB This expects HSQLDB version 1.8.0 and thus some methods and query might not work on ealier release of HSQLDB.
Points to override StandardRDBMSAdapter.
DELETE TAB1 FROM TAB1 WHERE TAB1.COL1 = ...
In this case, HSQLDB reports the error like,
Unexpected token TAB1, requires FROM in statement [delete tab1]
so, you need to change the SQL as
DELETE FROM TAB1 WHERE TAB1.COL1 = ...
Also, HSQLDB cannot execute the DELETE SQL which has join pattern in where
clause like, (although this looks to work in PostgreSQL, see PostgreSQLRDBMSAdapter)
DELETE TAB1 FROM TAB1.COL1 = TAB2.COL1 AND TAB2.COL2 = TAB3.COL2 AND...
The error message reported in above is very, very, very confusing, becase it says like
Column not found: COLNAME in statement
although the column "COLNAME" exists properly.
I observed this intermittently. Apparently, if the data matching to the condition exists,
it tends to report this error. Here, to avoid this,
DELETE TAB1 FROM TAB1.COL1 IN (SELECT TAB2.COL1 FROM TAB2,TAB3 WHERE TAB2.COLS2 = TAB3.COL2 ...
Implements SequenceAdapter
If #isSequenceSupported returns false,
| フィールドの概要 |
| クラス org.apache.slide.store.impl.rdbms.StandardRDBMSAdapter から継承したフィールド |
bcompress, LOG_CHANNEL |
| クラス org.apache.slide.store.impl.rdbms.AbstractRDBMSAdapter から継承したフィールド |
logger, service |
| コンストラクタの概要 | |
HSQLDBRDBMSAdapter(org.apache.slide.common.Service service,
org.apache.slide.util.logger.Logger logger)
|
|
| メソッドの概要 | |
protected void |
clearBinding(Connection connection,
org.apache.slide.common.Uri uri)
|
protected String |
convertRevisionNumberToComparable(String revisionNumber)
Determines sorting order from VERSION_HISTORY table by its REVISION_NO column. |
boolean |
createSequence(Connection conn,
String sequenceName)
|
boolean |
isSequenceSupported(Connection conn)
|
static int |
majorVersion(String revisionNumber)
For HSQLDB sorting by int order. |
static int |
minorVersion(String revisionNumber)
For HSQLDB sorting by int order. |
long |
nextSequenceValue(Connection conn,
String sequenceName)
|
protected static String |
normalizeSequenceName(String sequenceName)
|
void |
removeLock(Connection connection,
org.apache.slide.common.Uri uri,
org.apache.slide.lock.NodeLock lock)
|
void |
removeObject(Connection connection,
org.apache.slide.common.Uri uri,
org.apache.slide.structure.ObjectNode object)
|
void |
removeRevisionContent(Connection connection,
org.apache.slide.common.Uri uri,
org.apache.slide.content.NodeRevisionDescriptor revisionDescriptor)
|
void |
removeRevisionDescriptor(Connection connection,
org.apache.slide.common.Uri uri,
org.apache.slide.content.NodeRevisionNumber revisionNumber)
|
void |
removeRevisionDescriptors(Connection connection,
org.apache.slide.common.Uri uri)
|
void |
revokePermission(Connection connection,
org.apache.slide.common.Uri uri,
org.apache.slide.security.NodePermission permission)
|
void |
revokePermissions(Connection connection,
org.apache.slide.common.Uri uri)
|
boolean |
sequenceExists(Connection conn,
String sequenceName)
|
static int |
weightedVersion(String revisionNumber)
Spliting revisionNumber by revision delimiter (".") and returns weighted integer which is addition of each elements multiplied with the corresponding weights. |
| クラス org.apache.slide.store.impl.rdbms.StandardRDBMSAdapter から継承したメソッド |
assureBranchId, assureLabelId, assureUriId, assureVersionInfo, close, close, createException, createObject, createRevisionContent, createRevisionDescriptor, createRevisionDescriptors, enumerateLocks, enumeratePermissions, getRevisionNumberAsString, grantPermission, killLock, putLock, renewLock, retrieveObject, retrieveRevisionContent, retrieveRevisionDescriptor, retrieveRevisionDescriptors, setParameters, storeContent, storeObject, storeObject, storeRevisionContent, storeRevisionContent, storeRevisionDescriptor, storeRevisionDescriptors |
| クラス org.apache.slide.store.impl.rdbms.AbstractRDBMSAdapter から継承したメソッド |
getLogger |
| クラス java.lang.Object から継承したメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| コンストラクタの詳細 |
public HSQLDBRDBMSAdapter(org.apache.slide.common.Service service,
org.apache.slide.util.logger.Logger logger)
| メソッドの詳細 |
public void removeObject(Connection connection,
org.apache.slide.common.Uri uri,
org.apache.slide.structure.ObjectNode object)
throws org.apache.slide.common.ServiceAccessException,
org.apache.slide.structure.ObjectNotFoundException
org.apache.slide.store.impl.rdbms.RDBMSAdapter 内の removeObjectorg.apache.slide.common.ServiceAccessException
org.apache.slide.structure.ObjectNotFoundException
public void removeRevisionContent(Connection connection,
org.apache.slide.common.Uri uri,
org.apache.slide.content.NodeRevisionDescriptor revisionDescriptor)
throws org.apache.slide.common.ServiceAccessException
org.apache.slide.store.impl.rdbms.RDBMSAdapter 内の removeRevisionContentorg.apache.slide.common.ServiceAccessException
public void removeRevisionDescriptor(Connection connection,
org.apache.slide.common.Uri uri,
org.apache.slide.content.NodeRevisionNumber revisionNumber)
throws org.apache.slide.common.ServiceAccessException
org.apache.slide.store.impl.rdbms.RDBMSAdapter 内の removeRevisionDescriptororg.apache.slide.common.ServiceAccessException
public void removeRevisionDescriptors(Connection connection,
org.apache.slide.common.Uri uri)
throws org.apache.slide.common.ServiceAccessException
org.apache.slide.store.impl.rdbms.RDBMSAdapter 内の removeRevisionDescriptorsorg.apache.slide.common.ServiceAccessException
public void removeLock(Connection connection,
org.apache.slide.common.Uri uri,
org.apache.slide.lock.NodeLock lock)
throws org.apache.slide.common.ServiceAccessException,
org.apache.slide.lock.LockTokenNotFoundException
org.apache.slide.store.impl.rdbms.RDBMSAdapter 内の removeLockorg.apache.slide.common.ServiceAccessException
org.apache.slide.lock.LockTokenNotFoundException
public void revokePermission(Connection connection,
org.apache.slide.common.Uri uri,
org.apache.slide.security.NodePermission permission)
throws org.apache.slide.common.ServiceAccessException
org.apache.slide.store.impl.rdbms.RDBMSAdapter 内の revokePermissionorg.apache.slide.common.ServiceAccessException
public void revokePermissions(Connection connection,
org.apache.slide.common.Uri uri)
throws org.apache.slide.common.ServiceAccessException
org.apache.slide.store.impl.rdbms.RDBMSAdapter 内の revokePermissionsorg.apache.slide.common.ServiceAccessException
protected void clearBinding(Connection connection,
org.apache.slide.common.Uri uri)
throws org.apache.slide.common.ServiceAccessException,
org.apache.slide.structure.ObjectNotFoundException,
SQLException
org.apache.slide.common.ServiceAccessException
org.apache.slide.structure.ObjectNotFoundException
SQLExceptionprotected String convertRevisionNumberToComparable(String revisionNumber)
Determines sorting order from VERSION_HISTORY table by its REVISION_NO column.
As the type of REVISION_NO is VARCHAR, the default ordering rule doesn't provide desirable results. For example, we have 11 nodes, revisioned from 1.0 to 1.10. Under the default rule, the node 1.10 comes earlier than node 1.2. (here the number before dot is called "major", and one after dot called "minor")
StandardRDBMSAdapter#convertRevisionNumberToComparable uses convert function, though HSQLDB doesn't have it (see org.hsqldb.Library), thus here needed to override that method.
First, you can get this by the following mannger,
major = "java.lang.Integer.parseInt"(TRIM(TRAILING '.' FROM SUBSTRING(vh.REVISION_NO,1,LOCATE('.',vh.REVISION_NO))))This looks complicated, especially the first one uses 4 methods!!
minor = "java.lang.Integer.parseInt"(SUBSTRING(vh.REVISION_NO,LOCATE('.',vh.REVISION_NO)+1))
Thus, custom 2 simple methods are used, majorVersion and minorVersion defined in this class.
StandardRDBMSAdapter.retrieveRevisionDescriptors(java.sql.Connection, org.apache.slide.common.Uri)protected static String normalizeSequenceName(String sequenceName)
public boolean isSequenceSupported(Connection conn)
org.apache.slide.store.impl.rdbms.SequenceAdapter 内の isSequenceSupported
public boolean createSequence(Connection conn,
String sequenceName)
throws org.apache.slide.common.ServiceAccessException
org.apache.slide.store.impl.rdbms.SequenceAdapter 内の createSequenceorg.apache.slide.common.ServiceAccessException
public long nextSequenceValue(Connection conn,
String sequenceName)
throws org.apache.slide.common.ServiceAccessException
org.apache.slide.store.impl.rdbms.SequenceAdapter 内の nextSequenceValueorg.apache.slide.common.ServiceAccessException
public boolean sequenceExists(Connection conn,
String sequenceName)
throws org.apache.slide.common.ServiceAccessException
org.apache.slide.store.impl.rdbms.SequenceAdapter 内の sequenceExistsorg.apache.slide.common.ServiceAccessExceptionpublic static int majorVersion(String revisionNumber)
revisionNumber - must contains "." to separate here, and also
expects %d.%d style.
IllegalAugumentException - if revisionNumber doesn't contains ".".
NumberFormatException - if extracted string before "." doesn't decimal string.public static int minorVersion(String revisionNumber)
revisionNumber - must contains "." to separate here, and also
expects %d.%d style.
IllegalAugumentException - if revisionNumber doesn't contains ".".
NumberFormatException - if extracted string before "." doesn't decimal string.public static int weightedVersion(String revisionNumber)
revisionNumber - up to 10-depth supported (like 1.1.1.1.1.1.1.1.1.1)
IllegalStateException - if revisionNumber exceeds the support limit depth of branch.
|
|||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | ||||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | ||||||||||