ozeigermann 2003/11/25 01:16:27
Modified: proposals/stores/org/apache/slide/store/impl/rdbms
StandardRDBMSAdapter.java
Log:
Replaced SQLServer specific deletes with more general ones
Revision Changes Path
1.4 +17 -17
jakarta-slide/proposals/stores/org/apache/slide/store/impl/rdbms/StandardRDBMSAdapter.java
Index: StandardRDBMSAdapter.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/stores/org/apache/slide/store/impl/rdbms/StandardRDBMSAdapter.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- StandardRDBMSAdapter.java 21 Nov 2003 12:31:02 -0000 1.3
+++ StandardRDBMSAdapter.java 25 Nov 2003 09:16:27 -0000 1.4
@@ -229,7 +229,7 @@
try {
statement =
connection.prepareStatement(
- "delete from CHILDREN from CHILDREN c, URI u where c.URI_ID
= u.URI_ID and u.URI_STRING = ? or c.CHILD_URI_ID = u.URI_ID and u.URI_STRING = ?");
+ "delete CHILDREN from CHILDREN c, URI u where c.URI_ID =
u.URI_ID and u.URI_STRING = ? or c.CHILD_URI_ID = u.URI_ID and u.URI_STRING = ?");
statement.setString(1, uri.toString());
statement.setString(2, uri.toString());
statement.executeUpdate();
@@ -240,7 +240,7 @@
try {
statement =
connection.prepareStatement(
- "delete from LINKS from LINKS l, URI u where l.URI_ID =
u.URI_ID and u.URI_STRING = ?");
+ "delete LINKS from LINKS l, URI u where l.URI_ID = u.URI_ID
and u.URI_STRING = ?");
statement.setString(1, uri.toString());
statement.executeUpdate();
} finally {
@@ -251,7 +251,7 @@
try {
statement =
connection.prepareStatement(
- "delete from VERSION_HISTORY from VERSION_HISTORY vh, URI u
where vh.URI_ID = u.URI_ID and u.URI_STRING = ?");
+ "delete VERSION_HISTORY from VERSION_HISTORY vh, URI u
where vh.URI_ID = u.URI_ID and u.URI_STRING = ?");
statement.setString(1, uri.toString());
statement.executeUpdate();
} finally {
@@ -261,7 +261,7 @@
try {
statement =
connection.prepareStatement(
- "delete from VERSION from VERSION v, URI u where v.URI_ID =
u.URI_ID and u.URI_STRING = ?");
+ "delete VERSION from VERSION v, URI u where v.URI_ID =
u.URI_ID and u.URI_STRING = ?");
statement.setString(1, uri.toString());
statement.executeUpdate();
} finally {
@@ -271,7 +271,7 @@
try {
statement =
connection.prepareStatement(
- "delete from OBJECT from OBJECT o, URI u where o.URI_ID =
u.URI_ID and u.URI_STRING = ?");
+ "delete OBJECT from OBJECT o, URI u where o.URI_ID =
u.URI_ID and u.URI_STRING = ?");
statement.setString(1, uri.toString());
statement.executeUpdate();
} finally {
@@ -476,7 +476,7 @@
try {
statement =
connection.prepareStatement(
- "delete from LOCKS from URI u where LOCK_ID = u.URI_ID and
u.URI_STRING=?");
+ "delete LOCKS from URI u where LOCK_ID = u.URI_ID and
u.URI_STRING=?");
statement.setString(1, lock.getLockId());
statement.executeUpdate();
} finally {
@@ -485,7 +485,7 @@
try {
statement =
connection.prepareStatement(
- "delete from URI from LOCKS l where URI_ID = l.LOCK_ID and
URI_STRING=?");
+ "delete URI from LOCKS l where URI_ID = l.LOCK_ID and
URI_STRING=?");
statement.setString(1, lock.getLockId());
} finally {
close(statement);
@@ -587,7 +587,7 @@
NodeRevisionNumber revisionNumber = permission.getRevisionNumber();
statement =
connection.prepareStatement(
- "delete from PERMISSIONS from URI ou, URI su, URI au where
OBJECT_ID = ou.URI_ID and ou.URI_STRING = ? and SUBJECT_ID = su.URI_ID and
su.URI_STRING = ? and ACTION_ID = au.URI_ID and au.URI_STRING = ? and VERSION_NO"
+ "delete PERMISSIONS from URI ou, URI su, URI au where OBJECT_ID
= ou.URI_ID and ou.URI_STRING = ? and SUBJECT_ID = su.URI_ID and su.URI_STRING = ? and
ACTION_ID = au.URI_ID and au.URI_STRING = ? and VERSION_NO"
+ getRevisionNumberAsWhereQueryFragement(revisionNumber));
statement.setString(1, permission.getObjectUri());
statement.setString(2, permission.getSubjectUri());
@@ -606,7 +606,7 @@
try {
statement =
connection.prepareStatement(
- "delete from PERMISSIONS from URI u where OBJECT_ID = u.URI_ID
and u.URI_STRING = ?");
+ "delete PERMISSIONS from URI u where OBJECT_ID = u.URI_ID and
u.URI_STRING = ?");
statement.setString(1, uri.toString());
statement.executeUpdate();
} catch (SQLException e) {
@@ -671,7 +671,7 @@
try {
statement =
connection.prepareStatement(
- "delete from VERSION_CONTENT from VERSION_CONTENT vc,
VERSION_HISTORY vh, URI u where vc.VERSION_ID = vh.VERSION_ID and vh.REVISION_NO = ?
and vh.URI_ID=u.URI_ID AND u.URI_STRING=?");
+ "delete VERSION_CONTENT from VERSION_CONTENT vc,
VERSION_HISTORY vh, URI u where vc.VERSION_ID = vh.VERSION_ID and vh.REVISION_NO = ?
and vh.URI_ID=u.URI_ID AND u.URI_STRING=?");
statement.setString(1,
revisionDescriptor.getRevisionNumber().toString());
statement.setString(2, uri.toString());
statement.executeUpdate();
@@ -691,7 +691,7 @@
try {
statement =
connection.prepareStatement(
- "delete from VERSION_LABELS from VERSION_LABELS vl,
VERSION_HISTORY vh, URI u where vl.VERSION_ID = vh.VERSION_ID and vh.REVISION_NO = ?
and vh.URI_ID = u.URI_ID AND u.URI_STRING = ?");
+ "delete VERSION_LABELS from VERSION_LABELS vl,
VERSION_HISTORY vh, URI u where vl.VERSION_ID = vh.VERSION_ID and vh.REVISION_NO = ?
and vh.URI_ID = u.URI_ID AND u.URI_STRING = ?");
statement.setString(1, revisionNumber.toString());
statement.setString(2, uri.toString());
statement.executeUpdate();
@@ -701,7 +701,7 @@
try {
statement =
connection.prepareStatement(
- "delete from PROPERTIES from PROPERTIES p, VERSION_HISTORY
vh, URI u where p.VERSION_ID = vh.VERSION_ID and vh.REVISION_NO = ? and vh.URI_ID =
u.URI_ID AND u.URI_STRING = ?");
+ "delete PROPERTIES from PROPERTIES p, VERSION_HISTORY vh,
URI u where p.VERSION_ID = vh.VERSION_ID and vh.REVISION_NO = ? and vh.URI_ID =
u.URI_ID AND u.URI_STRING = ?");
statement.setString(1, revisionNumber.toString());
statement.setString(2, uri.toString());
statement.executeUpdate();
@@ -720,7 +720,7 @@
try {
statement =
connection.prepareStatement(
- "delete from VERSION_PREDS from VERSION_PREDS vp,
VERSION_HISTORY vh, URI u where vp.VERSION_ID = vh.VERSION_ID and vh.URI_ID = u.URI_ID
and u.URI_STRING = ?");
+ "delete VERSION_PREDS from VERSION_PREDS vp, VERSION_HISTORY
vh, URI u where vp.VERSION_ID = vh.VERSION_ID and vh.URI_ID = u.URI_ID and
u.URI_STRING = ?");
statement.setString(1, uri.toString());
} catch (SQLException e) {
getLogger().log(e, LOG_CHANNEL, Logger.ERROR);
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]