PolicySelectByContentTree.java :  » Content-Management-System » webman » de » webman » acl » db » queries » oracle » Java Open Source

Java Open Source » Content Management System » webman 
webman » de » webman » acl » db » queries » oracle » PolicySelectByContentTree.java
package de.webman.acl.db.queries.oracle;

import java.sql.Connection;
import java.sql.Types;
import com.teamkonzept.db.TKPrepQuery;

/**
 * $Header: /cvsroot/webman-cms/source/webman/de/webman/acl/db/queries/oracle/Attic/PolicySelectByContentTree.java,v 1.1 2001/08/20 08:25:09 mischa Exp $
 *
 * @version 0.10
 * @since 0.10
 * @author © 2000 Team-Konzept
 */
public class PolicySelectByContentTree
  extends TKPrepQuery
{

  // Constants

  public static final String[] ORDER =
  {
    "OBJECT_REFERENCE",
    "WM_USER_ID",
    "WM_CONTEXT_ID",
    "OBJECT_TYPE"
  };

  public static final Object[][] TYPES =
  {
    {"OBJECT_REFERENCE", new Integer(Types.INTEGER)},
    {"WM_USER_ID", new Integer(Types.INTEGER)},
    {"WM_CONTEXT_ID", new Integer(Types.INTEGER)},
    {"OBJECT_TYPE", new Integer(Types.INTEGER)}
  };

  public static final boolean[] RELEVANTS =
  {
    true
  };

  public static final String SQL = (new StringBuffer()).append("SELECT POLICY.WM_POLICY_ID ")
                             .append("FROM WM_POLICY POLICY, CONTENT_TREE CONTENT, CONTENT_TREE TREE ")
                             .append("WHERE ")
                             .append("    CONTENT.CONTENT_NODE_ID = ? AND ")
                             .append("    TREE.LEFT_NR <= CONTENT.LEFT_NR AND ")
                             .append("    TREE.RIGHT_NR >= CONTENT.RIGHT_NR AND ")
                             .append("    TREE.CONTENT_NODE_ID = POLICY.OBJECT_REFERENCE AND ")
                             .append("    POLICY.WM_USER_ID = ? AND ")
                             .append("    POLICY.WM_CONTEXT_ID = ? AND ")
                             .append("    POLICY.OBJECT_TYPE = ? ")
                             .append("ORDER BY TREE.LEFT_NR ASC")
                             .toString();


  // Method implementations

  public void initQuery (Connection connection)
  {
    super.initQuery(connection,
            true,
            ORDER,
            TYPES,
            RELEVANTS,
            SQL);
  }

}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.