You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by lu...@apache.org on 2005/04/06 11:25:00 UTC

cvs commit: jakarta-slide/src/stores/org/apache/slide/store/impl/rdbms CommonRDBMSAdapter.java

luetzkendorf    2005/04/06 02:25:00

  Modified:    src/stores/org/apache/slide/store/impl/rdbms
                        CommonRDBMSAdapter.java
  Log:
  Fix by Martin Kal�n applied.
  
  Revision  Changes    Path
  1.10      +13 -7     jakarta-slide/src/stores/org/apache/slide/store/impl/rdbms/CommonRDBMSAdapter.java
  
  Index: CommonRDBMSAdapter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/stores/org/apache/slide/store/impl/rdbms/CommonRDBMSAdapter.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- CommonRDBMSAdapter.java	30 Oct 2004 13:46:25 -0000	1.9
  +++ CommonRDBMSAdapter.java	6 Apr 2005 09:25:00 -0000	1.10
  @@ -225,10 +225,16 @@
           if (permission == null) return;
           PreparedStatement statement = null;
           try {
  -            NodeRevisionNumber revisionNumber = permission.getRevisionNumber();
  -            statement =
  -                connection.prepareStatement(
  -                    "delete from PERMISSIONS where PERMISSIONS.OBJECT_ID in (select ou.URI_ID from URI ou, URI su, URI au where 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" + ((revisionNumber == null) ? " IS NULL " : " = '" + revisionNumber.toString() + "'"));
  +            final NodeRevisionNumber revisionNumber = permission.getRevisionNumber();
  +            final String versionNoCriteria;
  +            
  +            if (revisionNumber == null) {
  +                versionNoCriteria = "IS NULL";
  +            } else {
  +                versionNoCriteria = "= '" + revisionNumber.toString() + "'";
  +            }
  +            statement = connection.prepareStatement(
  +                    "delete from PERMISSIONS where PERMISSIONS.OBJECT_ID in (select ou.URI_ID from URI ou, URI su, URI au where 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 " + versionNoCriteria + ")");
               statement.setString(1, permission.getObjectUri());
               statement.setString(2, permission.getSubjectUri());
               statement.setString(3, permission.getActionUri());
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org