portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject cvs commit: jakarta-jetspeed-2/components/prefs/src/java/org/apache/jetspeed/prefs/om Node.java Property.java PropertyKey.java
Date Wed, 05 May 2004 18:32:43 GMT
taylor      2004/05/05 11:32:43

  Modified:    components/prefs/src/java/org/apache/jetspeed/prefs/om/impl
                        PropertyImpl.java NodeImpl.java
                        PropertyKeyImpl.java
               components/prefs/src/java repository_prefs.xml
               components/prefs/src/java/org/apache/jetspeed/prefs/impl
                        PropertyManagerImpl.java PreferencesImpl.java
               components/prefs/src/test/org/apache/jetspeed/prefs
                        TestPropertyManager.java TestPreferences.java
               components/prefs/src/java/org/apache/jetspeed/prefs/om
                        Node.java Property.java PropertyKey.java
  Added:       components/prefs/src/test/org/apache/jetspeed/prefs
                        TestOracle.java
  Log:
  enable preferences component to work with Oracle database backend
  and be backward compatible with HSQL
  involved using BIGINT because of the way that OJB uses setObject on its JDBC objects
  also involved converting ints to longs, shorts to ints
  
  PR:
  Obtained from:
  Submitted by:	
  Reviewed by:	
  CVS: ----------------------------------------------------------------------
  CVS: PR:
  CVS:   If this change addresses a PR in the problem report tracking
  CVS:   database, then enter the PR number(s) here.
  CVS: Obtained from:
  CVS:   If this change has been taken from another system, such as NCSA,
  CVS:   then name the system in this line, otherwise delete it.
  CVS: Submitted by:
  CVS:   If this code has been contributed to Apache by someone else; i.e.,
  CVS:   they sent us a patch or a new module, then include their name/email
  CVS:   address here. If this is your work then delete this line.
  CVS: Reviewed by:
  CVS:   If we are doing pre-commit code reviews and someone else has
  CVS:   reviewed your changes, include their name(s) here.
  CVS:   If you have not had it reviewed then delete this line.
  
  Revision  Changes    Path
  1.3       +16 -19    jakarta-jetspeed-2/components/prefs/src/java/org/apache/jetspeed/prefs/om/impl/PropertyImpl.java
  
  Index: PropertyImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/prefs/src/java/org/apache/jetspeed/prefs/om/impl/PropertyImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PropertyImpl.java	6 Mar 2004 18:29:41 -0000	1.2
  +++ PropertyImpl.java	5 May 2004 18:32:43 -0000	1.3
  @@ -27,6 +27,9 @@
    */
   public class PropertyImpl implements Property
   {
  +    private long nodeId;
  +    private long propertyValueId;
  +    private long propertyKeyId;
       
       /**
        * <p>Property implementation default constructor.</p>
  @@ -51,7 +54,7 @@
        * @param valueObjectType The value object type.
        * @param valueObject The value object.
        */
  -    public PropertyImpl(int nodeId, int propertyKeyId, PropertyKey propertyKey, short valueObjectType,
Object valueObject)
  +    public PropertyImpl(long nodeId, long propertyKeyId, PropertyKey propertyKey, int valueObjectType,
Object valueObject)
       {
           this.nodeId = nodeId;
           this.propertyKeyId = propertyKeyId;
  @@ -63,9 +66,9 @@
       }
   
       /**
  -     * @see org.apache.jetspeed.prefs.om.Property#getPropertyValue(short)
  +     * @see org.apache.jetspeed.prefs.om.Property#getPropertyValue(int)
        */
  -    public final String getPropertyValue(short valueObjectType)
  +    public final String getPropertyValue(int valueObjectType)
       {
           String stringValue = null;
   
  @@ -93,9 +96,9 @@
       }
   
       /**
  -     * @see org.apache.jetspeed.prefs.om.Property#setPropertyValue(short, java.lang.String)
  +     * @see org.apache.jetspeed.prefs.om.Property#setPropertyValue(int, java.lang.String)
        */
  -    public final void setPropertyValue(short valueObjectType, String valueObject)
  +    public final void setPropertyValue(int valueObjectType, String valueObject)
       {
           if (null != valueObject)
           {
  @@ -122,12 +125,10 @@
           }
       }
   
  -    private int propertyValueId;
  -
       /**
        * @see org.apache.jetspeed.prefs.om.Property#getPropertyValueId()
        */
  -    public int getPropertyValueId()
  +    public long getPropertyValueId()
       {
           return this.propertyValueId;
       }
  @@ -135,43 +136,39 @@
       /**
        * @see org.apache.jetspeed.prefs.om.Property#setPropertyValueId(int)
        */
  -    public void setPropertyValueId(int propertyValueId)
  +    public void setPropertyValueId(long propertyValueId)
       {
           this.propertyValueId = propertyValueId;
       }
   
  -    private int nodeId;
  -
       /**
        * @see org.apache.jetspeed.prefs.om.Property#getNodeId()
        */
  -    public int getNodeId()
  +    public long getNodeId()
       {
           return this.nodeId;
       }
   
       /**
  -     * @see org.apache.jetspeed.prefs.om.Property#setNodeId(int)
  +     * @see org.apache.jetspeed.prefs.om.Property#setNodeId(long)
        */
  -    public void setNodeId(int nodeId)
  +    public void setNodeId(long nodeId)
       {
           this.nodeId = nodeId;
       }
   
  -    private int propertyKeyId;
  -
       /**
        * @see org.apache.jetspeed.prefs.om.Property#getPropertyKeyId()
        */
  -    public int getPropertyKeyId()
  +    public long getPropertyKeyId()
       {
           return this.propertyKeyId;
       }
   
       /**
  -     * @see org.apache.jetspeed.prefs.om.Property#setPropertyKeyId(int)
  +     * @see org.apache.jetspeed.prefs.om.Property#setPropertyKeyId(long)
        */
  -    public void setPropertyKeyId(int propertyKeyId)
  +    public void setPropertyKeyId(long propertyKeyId)
       {
           this.propertyKeyId = propertyKeyId;
       }
  
  
  
  1.4       +19 -27    jakarta-jetspeed-2/components/prefs/src/java/org/apache/jetspeed/prefs/om/impl/NodeImpl.java
  
  Index: NodeImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/prefs/src/java/org/apache/jetspeed/prefs/om/impl/NodeImpl.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- NodeImpl.java	6 Mar 2004 18:29:41 -0000	1.3
  +++ NodeImpl.java	5 May 2004 18:32:43 -0000	1.4
  @@ -28,6 +28,14 @@
    */
   public class NodeImpl implements Node
   {
  +    private long nodeId;
  +    private Long parentNodeId;
  +    private Collection nodeProperties;
  +    private Collection nodeKeys;
  +    private String nodeName;
  +    private int nodeType;
  +    private String fullPath;
  +    private Timestamp creationDate;
   
       /**
        * <p>Preferences node implementation default constructor.</p>
  @@ -40,7 +48,7 @@
        * <p>Node constructor given:</p>
        * <ul>
        *  <li>Parent node id,</li>
  -     *  <li>Property set definition id: Integer so that we can
  +     *  <li>Property set definition id: Long so that we can
        *  pass null value if the node does not have any properties
        *  associated to it,</li>
        *  <li>Node name,</li>
  @@ -52,8 +60,8 @@
        * @param nodeType The node type.
        * @param fullPath The full path.
        */
  -    public NodeImpl(Integer parentNodeId, String nodeName,
  -                    short nodeType, String fullPath)
  +    public NodeImpl(Long parentNodeId, String nodeName,
  +                    int nodeType, String fullPath)
       {
           this.parentNodeId = parentNodeId;
           this.nodeName = nodeName;
  @@ -65,12 +73,10 @@
           this.modifiedDate = this.creationDate;
       }
   
  -    private int nodeId;
  -
       /**
        * @see org.apache.jetspeed.prefs.om.Node#getNodeId()
        */
  -    public int getNodeId()
  +    public long getNodeId()
       {
           return this.nodeId;
       }
  @@ -78,31 +84,27 @@
       /**
        * @see org.apache.jetspeed.prefs.om.Node#setNodeId(int)
        */
  -    public void setNodeId(int nodeId)
  +    public void setNodeId(long nodeId)
       {
           this.nodeId = nodeId;
       }
   
  -    private Integer parentNodeId;
  -
       /**
        * @see org.apache.jetspeed.prefs.om.Node#getParentNodeId()
        */
  -    public Integer getParentNodeId()
  +    public Long getParentNodeId()
       {
           return this.parentNodeId;
       }
   
       /**
  -     * @see org.apache.jetspeed.prefs.om.Node#setParentNodeId(java.lang.Integer)
  +     * @see org.apache.jetspeed.prefs.om.Node#setParentNodeId(java.lang.Long)
        */
  -    public void setParentNodeId(Integer parentNodeId)
  +    public void setParentNodeId(Long parentNodeId)
       {
           this.parentNodeId = parentNodeId;
       }
   
  -    private Collection nodeProperties;
  -
       /**
        * @see org.apache.jetspeed.prefs.om.Node#getNodeProperties()
        */
  @@ -119,8 +121,6 @@
           this.nodeProperties = nodeProperties;
       }
   
  -    private Collection nodeKeys;
  -
       /**
        * @see org.apache.jetspeed.prefs.om.Node#getNodeKeys()
        */
  @@ -137,8 +137,6 @@
           this.nodeKeys = nodeKeys;
       }
   
  -    private String nodeName;
  -
       /**
        * @see org.apache.jetspeed.prefs.om.Node#getNodeName()
        */
  @@ -155,26 +153,22 @@
           this.nodeName = nodeName;
       }
   
  -    private short nodeType;
  -
       /**
        * @see org.apache.jetspeed.prefs.om.Node#getNodeType()
        */
  -    public short getNodeType()
  +    public int getNodeType()
       {
           return this.nodeType;
       }
   
       /**
  -     * @see org.apache.jetspeed.prefs.om.Node#setNodeType(short)
  +     * @see org.apache.jetspeed.prefs.om.Node#setNodeType(int)
        */
  -    public void setNodeType(short nodeType)
  +    public void setNodeType(int nodeType)
       {
           this.nodeType = nodeType;
       }
   
  -    private String fullPath;
  -
       /**
        * @see org.apache.jetspeed.prefs.om.Node#getFullPath()
        */
  @@ -190,8 +184,6 @@
       {
           this.fullPath = fullPath;
       }
  -
  -    private Timestamp creationDate;
   
       /**
        * @see org.apache.jetspeed.prefs.om.Node#getCreationDate()
  
  
  
  1.3       +8 -9      jakarta-jetspeed-2/components/prefs/src/java/org/apache/jetspeed/prefs/om/impl/PropertyKeyImpl.java
  
  Index: PropertyKeyImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/prefs/src/java/org/apache/jetspeed/prefs/om/impl/PropertyKeyImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PropertyKeyImpl.java	6 Mar 2004 18:29:41 -0000	1.2
  +++ PropertyKeyImpl.java	5 May 2004 18:32:43 -0000	1.3
  @@ -26,6 +26,8 @@
    */
   public class PropertyKeyImpl implements PropertyKey
   {
  +    private long propertyKeyId;
  +    private int propertyKeyType;
   
       /**
        * <p>Property key implementation default constructor.</p>
  @@ -41,7 +43,7 @@
        * @param propertyKeyType The property key type.
        */
       public PropertyKeyImpl(String propertyKeyName,
  -                           short propertyKeyType)
  +                           int propertyKeyType)
       {
           this.propertyKeyName = propertyKeyName;
           this.propertyKeyType = propertyKeyType;
  @@ -49,12 +51,11 @@
           this.modifiedDate = this.creationDate;
       }
   
  -    private int propertyKeyId;
   
       /**
        * @see org.apache.jetspeed.prefs.om.PropertyKey#getPropertyKeyId()
        */
  -    public int getPropertyKeyId()
  +    public long getPropertyKeyId()
       {
           return this.propertyKeyId;
       }
  @@ -62,7 +63,7 @@
       /**
        * @see org.apache.jetspeed.prefs.om.PropertyKey#setPropertyKeyId(int)
        */
  -    public void setPropertyKeyId(int propertyKeyId)
  +    public void setPropertyKeyId(long propertyKeyId)
       {
           this.propertyKeyId = propertyKeyId;
       }
  @@ -85,20 +86,18 @@
           this.propertyKeyName = propertyKeyName;
       }
   
  -    private short propertyKeyType;
  -
       /**
        * @see org.apache.jetspeed.prefs.om.PropertyKey#getPropertyKeyType()
        */
  -    public short getPropertyKeyType()
  +    public int getPropertyKeyType()
       {
           return this.propertyKeyType;
       }
   
       /**
  -     * @see org.apache.jetspeed.prefs.om.PropertyKey#setPropertyKeyType(short)
  +     * @see org.apache.jetspeed.prefs.om.PropertyKey#setPropertyKeyType(int)
        */
  -    public void setPropertyKeyType(short propertyKeyType)
  +    public void setPropertyKeyType(int propertyKeyType)
       {
           this.propertyKeyType = propertyKeyType;
       }
  
  
  
  1.4       +7 -7      jakarta-jetspeed-2/components/prefs/src/java/repository_prefs.xml
  
  Index: repository_prefs.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/prefs/src/java/repository_prefs.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- repository_prefs.xml	18 Mar 2004 19:32:12 -0000	1.3
  +++ repository_prefs.xml	5 May 2004 18:32:43 -0000	1.4
  @@ -25,7 +25,7 @@
       <field-descriptor
           name="nodeId"
           column="NODE_ID"
  -        jdbc-type="INTEGER"
  +        jdbc-type="BIGINT"
           primarykey="true"
           autoincrement="true"
       >
  @@ -33,7 +33,7 @@
       <field-descriptor
           name="parentNodeId"
           column="PARENT_NODE_ID"
  -        jdbc-type="INTEGER"
  +        jdbc-type="BIGINT"
           nullable="true"
       >
       </field-descriptor>
  @@ -108,7 +108,7 @@
       <field-descriptor
           name="propertyKeyId"
           column="PROPERTY_KEY_ID"
  -        jdbc-type="INTEGER"
  +        jdbc-type="BIGINT"
           primarykey="true"
           autoincrement="true"
       >
  @@ -156,7 +156,7 @@
       <field-descriptor
           name="propertyValueId"
           column="PROPERTY_VALUE_ID"
  -        jdbc-type="INTEGER"
  +        jdbc-type="BIGINT"
           primarykey="true"
           autoincrement="true"
       >
  @@ -164,14 +164,14 @@
       <field-descriptor
           name="nodeId"
           column="NODE_ID"
  -        jdbc-type="INTEGER"
  +        jdbc-type="BIGINT"
           nullable="false"
       >
       </field-descriptor>
       <field-descriptor
           name="propertyKeyId"
           column="PROPERTY_KEY_ID"
  -        jdbc-type="INTEGER"
  +        jdbc-type="BIGINT"
           nullable="false"
       >
       </field-descriptor>
  @@ -192,7 +192,7 @@
       <field-descriptor
           name="longPropertyValue"
           column="LONG_VALUE"
  -        jdbc-type="INTEGER"
  +        jdbc-type="BIGINT"
           nullable="true"
       >
       </field-descriptor>
  
  
  
  1.5       +13 -13    jakarta-jetspeed-2/components/prefs/src/java/org/apache/jetspeed/prefs/impl/PropertyManagerImpl.java
  
  Index: PropertyManagerImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/prefs/src/java/org/apache/jetspeed/prefs/impl/PropertyManagerImpl.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- PropertyManagerImpl.java	25 Mar 2004 21:40:52 -0000	1.4
  +++ PropertyManagerImpl.java	5 May 2004 18:32:43 -0000	1.5
  @@ -45,10 +45,10 @@
       private static final Log log = LogFactory.getLog(PropertyManagerImpl.class);
   
       /** User <tt>Preferences<tt> node type. */
  -    private static final short USER_NODE_TYPE = 0;
  +    private static final int USER_NODE_TYPE = 0;
   
       /** System <tt>Preferences</tt> node type. */
  -    private static final short SYSTEM_NODE_TYPE = 1;
  +    private static final int SYSTEM_NODE_TYPE = 1;
   
       /** The persistence store container. */
       private PersistenceStoreContainer storeContainer;
  @@ -90,13 +90,13 @@
           {
               nodeObj =
                   (Node) store.getObjectByQuery(
  -                    commonQueries.newNodeQueryByPathAndType(prefNode.absolutePath(), new
Short(USER_NODE_TYPE)));
  +                    commonQueries.newNodeQueryByPathAndType(prefNode.absolutePath(), new
Integer(USER_NODE_TYPE)));
           }
           else
           {
               nodeObj =
                   (Node) store.getObjectByQuery(
  -                    commonQueries.newNodeQueryByPathAndType(prefNode.absolutePath(), new
Short(SYSTEM_NODE_TYPE)));
  +                    commonQueries.newNodeQueryByPathAndType(prefNode.absolutePath(), new
Integer(SYSTEM_NODE_TYPE)));
           }
           if (null != nodeObj)
           {
  @@ -126,7 +126,7 @@
                       PropertyKey ppk =
                           new PropertyKeyImpl(
                               currentPropertyKeyName,
  -                            ((Short) propertyKeysMap.get(currentPropertyKeyName)).shortValue());
  +                            ((Integer) propertyKeysMap.get(currentPropertyKeyName)).intValue());
                       newPropertyKeys.add(ppk);
                   }
               }
  @@ -170,13 +170,13 @@
           {
               nodeObj =
                   (Node) store.getObjectByQuery(
  -                    commonQueries.newNodeQueryByPathAndType(prefNode.absolutePath(), new
Short(USER_NODE_TYPE)));
  +                    commonQueries.newNodeQueryByPathAndType(prefNode.absolutePath(), new
Integer(USER_NODE_TYPE)));
           }
           else
           {
               nodeObj =
                   (Node) store.getObjectByQuery(
  -                    commonQueries.newNodeQueryByPathAndType(prefNode.absolutePath(), new
Short(SYSTEM_NODE_TYPE)));
  +                    commonQueries.newNodeQueryByPathAndType(prefNode.absolutePath(), new
Integer(SYSTEM_NODE_TYPE)));
           }
           if (null != nodeObj)
           {
  @@ -185,7 +185,7 @@
               for (Iterator i = keys.iterator(); i.hasNext();)
               {
                   PropertyKey curpk = (PropertyKey) i.next();
  -                propertyKeysMap.put(curpk.getPropertyKeyName(), new Short(curpk.getPropertyKeyType()));
  +                propertyKeysMap.put(curpk.getPropertyKeyName(), new Integer(curpk.getPropertyKeyType()));
               }
               return propertyKeysMap;
           }
  @@ -211,13 +211,13 @@
           {
               nodeObj =
                   (Node) store.getObjectByQuery(
  -                    commonQueries.newNodeQueryByPathAndType(prefNode.absolutePath(), new
Short(USER_NODE_TYPE)));
  +                    commonQueries.newNodeQueryByPathAndType(prefNode.absolutePath(), new
Integer(USER_NODE_TYPE)));
           }
           else
           {
               nodeObj =
                   (Node) store.getObjectByQuery(
  -                    commonQueries.newNodeQueryByPathAndType(prefNode.absolutePath(), new
Short(SYSTEM_NODE_TYPE)));
  +                    commonQueries.newNodeQueryByPathAndType(prefNode.absolutePath(), new
Integer(SYSTEM_NODE_TYPE)));
           }
           if (null != nodeObj)
           {
  @@ -281,13 +281,13 @@
           {
               nodeObj =
                   (Node) store.getObjectByQuery(
  -                    commonQueries.newNodeQueryByPathAndType(prefNode.absolutePath(), new
Short(USER_NODE_TYPE)));
  +                    commonQueries.newNodeQueryByPathAndType(prefNode.absolutePath(), new
Integer(USER_NODE_TYPE)));
           }
           else
           {
               nodeObj =
                   (Node) store.getObjectByQuery(
  -                    commonQueries.newNodeQueryByPathAndType(prefNode.absolutePath(), new
Short(SYSTEM_NODE_TYPE)));
  +                    commonQueries.newNodeQueryByPathAndType(prefNode.absolutePath(), new
Integer(SYSTEM_NODE_TYPE)));
           }
           if (null != nodeObj)
           {
  @@ -305,7 +305,7 @@
                           {
                               store.lockForWrite(curPropKey);
                               curPropKey.setPropertyKeyName(newKey);
  -                            curPropKey.setPropertyKeyType(((Short) newPropertyKey.get(newKey)).shortValue());
  +                            curPropKey.setPropertyKeyType(((Integer) newPropertyKey.get(newKey)).intValue());
                               curPropKey.setModifiedDate(new Timestamp(System.currentTimeMillis()));
                               if (log.isDebugEnabled())
                                   log.debug("Updated property key: " + curPropKey.toString());
  
  
  
  1.8       +32 -32    jakarta-jetspeed-2/components/prefs/src/java/org/apache/jetspeed/prefs/impl/PreferencesImpl.java
  
  Index: PreferencesImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/prefs/src/java/org/apache/jetspeed/prefs/impl/PreferencesImpl.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- PreferencesImpl.java	25 Mar 2004 21:40:52 -0000	1.7
  +++ PreferencesImpl.java	5 May 2004 18:32:43 -0000	1.8
  @@ -45,10 +45,10 @@
   {
   
       /** User <tt>Preferences<tt> node type. */
  -    private static final short USER_NODE_TYPE = 0;
  +    private static final int USER_NODE_TYPE = 0;
   
       /** System <tt>Preferences</tt> node type. */
  -    private static final short SYSTEM_NODE_TYPE = 1;
  +    private static final int SYSTEM_NODE_TYPE = 1;
   
       /** The component manager. */
       private ComponentManager cm;
  @@ -66,13 +66,13 @@
       private boolean isBackingStoreAvailable = true;
   
       /** The current node id. */
  -    private int nodeId = -1;
  +    private long nodeId = -1;
   
       /** The current <code>Node</code> object. */
       private Node node = null;
   
       /** The current node type. */
  -    private short nodeType = -1;
  +    private int nodeType = -1;
   
       /** Logger. */
       private static final Log log = LogFactory.getLog(PreferencesImpl.class);
  @@ -106,7 +106,7 @@
        * @param nodeName The node name.
        * @param nodeType The node type.
        */
  -    public PreferencesImpl(PreferencesImpl parent, String nodeName, short nodeType)
  +    public PreferencesImpl(PreferencesImpl parent, String nodeName, int nodeType)
       {
           super(parent, nodeName);
   
  @@ -118,7 +118,7 @@
           this.commonQueries = new CommonQueries(storeContainer, jetspeedStoreName);
   
           this.nodeType = nodeType;
  -        int[] result = createPrefNode(parent, nodeName, nodeType, this.absolutePath());
  +        long[] result = createPrefNode(parent, nodeName, nodeType, this.absolutePath());
           if (result[ERROR_CODE] != ERROR_SUCCESS)
           {
               String warning =
  @@ -144,35 +144,35 @@
        * @param fullPath The node full path.
        * @return The operation status code.
        */
  -    private int[] createPrefNode(PreferencesImpl parent, String nodeName, short nodeType,
String fullPath)
  +    private long[] createPrefNode(PreferencesImpl parent, String nodeName, int nodeType,
String fullPath)
       {
  -        int[] result = new int[ARRAY_SIZE];
  -        Integer parentNodeId = null;
  +        long[] result = new long[ARRAY_SIZE];
  +        Long parentNodeId = null;
   
           if (null != parent)
           {
               if (log.isDebugEnabled())
                   log.debug("Current node parent: " + parent.nodeId);
               // Get child node
  -            Object[] nodeFromParentRetrievalResult = getChildNode(new Integer(parent.nodeId),
nodeName, new Short(nodeType));
  -            if (((Integer) nodeFromParentRetrievalResult[ERROR_CODE]).intValue() == ERROR_SUCCESS)
  +            Object[] nodeFromParentRetrievalResult = getChildNode(new Long(parent.nodeId),
nodeName, new Integer(nodeType));
  +            if (((Long) nodeFromParentRetrievalResult[ERROR_CODE]).intValue() == ERROR_SUCCESS)
               {
  -                result[NODE_ID] = ((Integer) nodeFromParentRetrievalResult[NODE_ID]).intValue();
  +                result[NODE_ID] = ((Long) nodeFromParentRetrievalResult[NODE_ID]).intValue();
                   result[ERROR_CODE] = ERROR_SUCCESS;
                   result[DISPOSITION] = DISPOSITION_EXISTING_NODE;
                   return result;
               }
               else
               {
  -                parentNodeId = new Integer(parent.nodeId);
  +                parentNodeId = new Long(parent.nodeId);
               }
   
           }
           // Check if node exists.
           Object[] nodeRetrievalResult = getNode(fullPath, nodeType);
  -        if (((Integer) nodeRetrievalResult[ERROR_CODE]).intValue() == ERROR_SUCCESS)
  +        if (((Long) nodeRetrievalResult[ERROR_CODE]).intValue() == ERROR_SUCCESS)
           {
  -            result[NODE_ID] = ((Integer) nodeRetrievalResult[NODE_ID]).intValue();
  +            result[NODE_ID] = ((Long) nodeRetrievalResult[NODE_ID]).intValue();
               result[ERROR_CODE] = ERROR_SUCCESS;
               result[DISPOSITION] = DISPOSITION_EXISTING_NODE;
               return result;
  @@ -218,7 +218,7 @@
        *          <li>At index ERROR_CODE: The error code.</li>
        *         </ul>
        */
  -    private Object[] getNode(String fullPath, short nodeType)
  +    private Object[] getNode(String fullPath, int nodeType)
       {
           Object[] result = new Object[ARRAY_SIZE];
           if (log.isDebugEnabled())
  @@ -226,19 +226,19 @@
   
           if (this.nodeId != -1 && (null != this.node))
           {
  -            result[NODE_ID] = new Integer(this.nodeId);
  +            result[NODE_ID] = new Long(this.nodeId);
               result[NODE] = this.node;
  -            result[ERROR_CODE] = new Integer(ERROR_SUCCESS);
  +            result[ERROR_CODE] = new Long(ERROR_SUCCESS);
               return result;
           }
   
           PersistenceStore store = getPersistenceStore();
  -        Node nodeObj = (Node) store.getObjectByQuery(commonQueries.newNodeQueryByPathAndType(fullPath,
new Short(nodeType)));
  +        Node nodeObj = (Node) store.getObjectByQuery(commonQueries.newNodeQueryByPathAndType(fullPath,
new Integer(nodeType)));
           if (null != nodeObj)
           {
  -            result[NODE_ID] = new Integer(nodeObj.getNodeId());
  +            result[NODE_ID] = new Long(nodeObj.getNodeId());
               result[NODE] = nodeObj;
  -            result[ERROR_CODE] = new Integer(ERROR_SUCCESS);
  +            result[ERROR_CODE] = new Long(ERROR_SUCCESS);
               if (log.isDebugEnabled())
                   log.debug("Found node: " + nodeObj.getFullPath());
               this.node = nodeObj;
  @@ -247,7 +247,7 @@
           }
           else
           {
  -            result[ERROR_CODE] = new Integer(ERROR_NODE_NOT_FOUND);
  +            result[ERROR_CODE] = new Long(ERROR_NODE_NOT_FOUND);
               return result;
           }
       }
  @@ -262,7 +262,7 @@
        *          <li>At index ERROR_CODE: The error code.</li>
        *         </ul>
        */
  -    private Object[] getChildNode(Integer parentIdObject, String nodeName, Short nodeType)
  +    private Object[] getChildNode(Long parentIdObject, String nodeName, Integer nodeType)
       {
           Object[] result = new Object[ARRAY_SIZE];
           PersistenceStore store = getPersistenceStore();
  @@ -270,9 +270,9 @@
               (Node) store.getObjectByQuery(commonQueries.newNodeQueryByParentIdNameAndType(parentIdObject,
nodeName, nodeType));
           if (null != nodeObj)
           {
  -            result[NODE_ID] = new Integer(nodeObj.getNodeId());
  +            result[NODE_ID] = new Long(nodeObj.getNodeId());
               result[NODE] = nodeObj;
  -            result[ERROR_CODE] = new Integer(ERROR_SUCCESS);
  +            result[ERROR_CODE] = new Long(ERROR_SUCCESS);
               if (log.isDebugEnabled())
                   log.debug("Found child node: " + nodeObj.getFullPath());
               this.nodeId = nodeObj.getNodeId();
  @@ -281,7 +281,7 @@
           }
           else
           {
  -            result[ERROR_CODE] = new Integer(ERROR_NODE_NOT_FOUND);
  +            result[ERROR_CODE] = new Long(ERROR_NODE_NOT_FOUND);
               return result;
           }
       }
  @@ -293,7 +293,7 @@
       {
           Object[] parentResult = getNode(this.absolutePath(), this.nodeType);
   
  -        if (((Integer) parentResult[ERROR_CODE]).intValue() != ERROR_SUCCESS)
  +        if (((Long) parentResult[ERROR_CODE]).intValue() != ERROR_SUCCESS)
           {
               String warning = "Could not get node id. Returned error code " + parentResult[ERROR_CODE];
               if (log.isWarnEnabled())
  @@ -346,7 +346,7 @@
           String value = null;
           Object[] nodeResult = getNode(this.absolutePath(), this.nodeType);
   
  -        if (((Integer) nodeResult[ERROR_CODE]).intValue() != ERROR_SUCCESS)
  +        if (((Long) nodeResult[ERROR_CODE]).intValue() != ERROR_SUCCESS)
           {
               log.error("Could not get node id. Returned error code " + nodeResult[ERROR_CODE]);
               return value;
  @@ -376,7 +376,7 @@
           ArrayList propertyNames = new ArrayList();
   
           PersistenceStore store = getPersistenceStore();
  -        Node nodeObj = (Node) store.getObjectByQuery(commonQueries.newNodeQueryById(new
Integer(this.nodeId)));
  +        Node nodeObj = (Node) store.getObjectByQuery(commonQueries.newNodeQueryById(new
Long(this.nodeId)));
           if (log.isDebugEnabled())
               log.debug("Fetching keys for node: " + nodeObj.toString());
           if (null != nodeObj)
  @@ -409,7 +409,7 @@
       {
           Object[] nodeResult = getNode(this.absolutePath(), this.nodeType);
   
  -        if (((Integer) nodeResult[ERROR_CODE]).intValue() != ERROR_SUCCESS)
  +        if (((Long) nodeResult[ERROR_CODE]).intValue() != ERROR_SUCCESS)
           {
               log.error("Could not get node id. Returned error code " + nodeResult[ERROR_CODE]);
               return;
  @@ -497,7 +497,7 @@
               log.debug("Attempting to remove node: " + this.absolutePath());
           Object[] nodeResult = getNode(this.absolutePath(), this.nodeType);
   
  -        if (((Integer) nodeResult[ERROR_CODE]).intValue() != ERROR_SUCCESS)
  +        if (((Long) nodeResult[ERROR_CODE]).intValue() != ERROR_SUCCESS)
           {
               String warning = "Could not get node id. Returned error code " + nodeResult[ERROR_CODE];
               if (log.isWarnEnabled())
  @@ -530,7 +530,7 @@
       {
           Object[] nodeResult = getNode(this.absolutePath(), this.nodeType);
   
  -        if (((Integer) nodeResult[ERROR_CODE]).intValue() != ERROR_SUCCESS)
  +        if (((Long) nodeResult[ERROR_CODE]).intValue() != ERROR_SUCCESS)
           {
               log.error("Could not get node id. Returned error code " + nodeResult[ERROR_CODE]);
               return;
  
  
  
  1.13      +8 -8      jakarta-jetspeed-2/components/prefs/src/test/org/apache/jetspeed/prefs/TestPropertyManager.java
  
  Index: TestPropertyManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/prefs/src/test/org/apache/jetspeed/prefs/TestPropertyManager.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- TestPropertyManager.java	25 Mar 2004 21:40:52 -0000	1.12
  +++ TestPropertyManager.java	5 May 2004 18:32:43 -0000	1.13
  @@ -48,8 +48,8 @@
       /**
        * <p>Defines property set types.</p>
        */
  -    private final static short USER_PROPERTY_SET_TYPE = 0;
  -    private final static short SYSTEM_PROPERTY_SET_TYPE = 1;
  +    private final static int USER_PROPERTY_SET_TYPE = 0;
  +    private final static int SYSTEM_PROPERTY_SET_TYPE = 1;
   
       /**
        * <p>Defines the test case name for junit.</p>
  @@ -138,12 +138,12 @@
           {
               // New key
               HashMap newKey = new HashMap(1);
  -            newKey.put("newPropertyName0", new Short("0"));
  +            newKey.put("newPropertyName0", new Integer("0"));
               pms.updatePropertyKey("propertyName0", pref, newKey);
               Map propKeys = pms.getPropertyKeys(pref);
               assertTrue("should contain newPropertyName0", propKeys.containsKey("newPropertyName0"));
               HashMap oldKey = new HashMap(1);
  -            oldKey.put("propertyName0", new Short("0"));
  +            oldKey.put("propertyName0", new Integer("0"));
               pms.updatePropertyKey("NewPropertyName0", pref, oldKey);
           }
           catch (PropertyException pex)
  @@ -179,10 +179,10 @@
       {
           // Build a few property keys.
           Map propertyKeys = new HashMap();
  -        propertyKeys.put("propertyName0", new Short("0"));
  -        propertyKeys.put("propertyName1", new Short("1"));
  -        propertyKeys.put("propertyName2", new Short("2"));
  -        propertyKeys.put("propertyName3", new Short("3"));
  +        propertyKeys.put("propertyName0", new Integer("0"));
  +        propertyKeys.put("propertyName1", new Integer("1"));
  +        propertyKeys.put("propertyName2", new Integer("2"));
  +        propertyKeys.put("propertyName3", new Integer("3"));
   
           return propertyKeys;
       }
  
  
  
  1.12      +6 -6      jakarta-jetspeed-2/components/prefs/src/test/org/apache/jetspeed/prefs/TestPreferences.java
  
  Index: TestPreferences.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/prefs/src/test/org/apache/jetspeed/prefs/TestPreferences.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- TestPreferences.java	25 Mar 2004 21:40:52 -0000	1.11
  +++ TestPreferences.java	5 May 2004 18:32:43 -0000	1.12
  @@ -48,8 +48,8 @@
       /**
        * <p>Defines property set types.</p>
        */
  -    private final static short USER_PROPERTY_SET_TYPE = 0;
  -    private final static short SYSTEM_PROPERTY_SET_TYPE = 1;
  +    private final static int USER_PROPERTY_SET_TYPE = 0;
  +    private final static int SYSTEM_PROPERTY_SET_TYPE = 1;
   
       /**
        * <p>Defines the test case name for junit.</p>
  @@ -234,10 +234,10 @@
       {
           // Build a few property keys.
           Map propertyKeys = new HashMap();
  -        propertyKeys.put("propertyName0", new Short("0"));
  -        propertyKeys.put("propertyName1", new Short("1"));
  -        propertyKeys.put("propertyName2", new Short("2"));
  -        propertyKeys.put("propertyName3", new Short("3"));
  +        propertyKeys.put("propertyName0", new Integer("0"));
  +        propertyKeys.put("propertyName1", new Integer("1"));
  +        propertyKeys.put("propertyName2", new Integer("2"));
  +        propertyKeys.put("propertyName3", new Integer("3"));
   
           return propertyKeys;
       }
  
  
  
  1.1                  jakarta-jetspeed-2/components/prefs/src/test/org/apache/jetspeed/prefs/TestOracle.java
  
  Index: TestOracle.java
  ===================================================================
  /*
   * Copyright 2000-2001,2004 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  package org.apache.jetspeed.prefs;
  
  import junit.framework.TestCase;
  import java.sql.*; 
  
  /**
   * TestOracle
   *
   * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
   * @version $Id: TestOracle.java,v 1.1 2004/05/05 18:32:43 taylor Exp $
   */
  public class TestOracle extends TestCase
  {
  
      public void testDriver() throws Exception  
      {         
          // Load Oracle driver
          
          DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());
           
          // Connect to the local database
          
          Connection conn = 
            DriverManager.getConnection ("jdbc:oracle:thin:@nirvana:1521:bluesun3", 
                                         "j2test", "digital");
          
          String sql = "SELECT A0.NODE_NAME, A0.MODIFIED_DATE, A0.NODE_TYPE, A0.PARENT_NODE_ID,
A0.FULL_PATH, A0.NODE_ID, A0.CREATION_DATE " +
                       "FROM PREFS_NODE A0 WHERE (A0.FULL_PATH = ?) AND A0.NODE_TYPE = ?";
          
          PreparedStatement stmt = conn.prepareStatement (sql);
          stmt.setObject(1, "whatever");
          stmt.setObject(2, new Integer(393));
          
          ResultSet rset = stmt.executeQuery ("select NODE_ID from PREFS_NODE");
          
          // Print the name out 
          
          while (rset.next ())
          {
            System.out.println (rset.getString (1));
          }
      } 
  }
  
  
  
  1.3       +6 -6      jakarta-jetspeed-2/components/prefs/src/java/org/apache/jetspeed/prefs/om/Node.java
  
  Index: Node.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/prefs/src/java/org/apache/jetspeed/prefs/om/Node.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Node.java	6 Mar 2004 18:30:27 -0000	1.2
  +++ Node.java	5 May 2004 18:32:43 -0000	1.3
  @@ -31,13 +31,13 @@
        * <p>Getter for the node id.</p>
        * @return The node id.
        */
  -    int getNodeId();
  +    long getNodeId();
   
       /**
        * <p>Setter for the node id.</p>
        * @param nodeId The node id.
        */
  -    void setNodeId(int nodeId);
  +    void setNodeId(long nodeId);
   
       /**
        * <p>Getter for the parent node id.</p>
  @@ -45,13 +45,13 @@
        * is associated to a node.</p>
        * @return The parent node id.
        */
  -    Integer getParentNodeId();
  +    Long getParentNodeId();
   
       /**
        * <p>Setter for the parent node id.</p>
        * @param parentNodeId The parent node id.
        */
  -    void setParentNodeId(Integer parentNodeId);
  +    void setParentNodeId(Long parentNodeId);
   
       /**
        * <p>Getter for the node properties.</p>
  @@ -97,7 +97,7 @@
        * </ul>
        * @return The node type.
        */
  -    short getNodeType();
  +    int getNodeType();
   
       /**
        * <p>Setter for the node type.</p>
  @@ -107,7 +107,7 @@
        * </ul>
        * @param nodeType The node type.
        */
  -    void setNodeType(short nodeType);
  +    void setNodeType(int nodeType);
   
       /**
        * <p>Getter for the full path.</p>
  
  
  
  1.2       +13 -13    jakarta-jetspeed-2/components/prefs/src/java/org/apache/jetspeed/prefs/om/Property.java
  
  Index: Property.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/prefs/src/java/org/apache/jetspeed/prefs/om/Property.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Property.java	26 Feb 2004 04:30:46 -0000	1.1
  +++ Property.java	5 May 2004 18:32:43 -0000	1.2
  @@ -26,55 +26,55 @@
   {
   
       /** <p>Constant for <code>boolean</code> property value object type.</p>
*/
  -    short BOOLEAN_TYPE = 0;
  +    int BOOLEAN_TYPE = 0;
   
       /** <p>Constant for <code>long</code> property value object type.</p>
*/
  -    short LONG_TYPE = 1;
  +    int LONG_TYPE = 1;
   
       /** <p>Constant for <code>double</code> property value object type.</p>
*/
  -    short DOUBLE_TYPE = 2;
  +    int DOUBLE_TYPE = 2;
   
       /** <p>Constant for <code>String</code> property value object type.</p>
*/
  -    short STRING_TYPE = 3;
  +    int STRING_TYPE = 3;
   
       /** <p>Constant for <code>Timestamp</code> property value object
type.</p> */
  -    short TIMESTAMP_TYPE = 3;
  +    int TIMESTAMP_TYPE = 3;
   
       /**
        * <p>Getter for the property value id.</p>
        * @return The property value id.
        */
  -    int getPropertyValueId();
  +    long getPropertyValueId();
   
       /**
        * <p>Setter for the property value id.</p>
        * @param propertyValueId The property value id.
        */
  -    void setPropertyValueId(int propertyValueId);
  +    void setPropertyValueId(long propertyValueId);
   
       /**
        * <p>Getter for the node id.</p>
        * @return The node id.
        */
  -    int getNodeId();
  +    long getNodeId();
   
       /**
        * <p>Setter for the node id.</p>
        * @param nodeId The node id.
        */
  -    void setNodeId(int nodeId);
  +    void setNodeId(long nodeId);
   
       /**
        * <p>Getter for the node id.</p>
        * @return The property key id.
        */
  -    int getPropertyKeyId();
  +    long getPropertyKeyId();
   
       /**
        * <p>Setter for the property key id.</p>
        * @param propertyKeyId The property key id.
        */
  -    void setPropertyKeyId(int propertyKeyId);
  +    void setPropertyKeyId(long propertyKeyId);
   
       /**
        * <p>Getter for the property key object.</p>
  @@ -94,7 +94,7 @@
        * @param valueObjectType The value object type.
        * @return The property value as a String.
        */
  -    String getPropertyValue(short valueObjectType);
  +    String getPropertyValue(int valueObjectType);
   
       /**
        * <p>Utility method used to identify with property value to set
  @@ -102,7 +102,7 @@
        * @param valueObjectType The value object type.
        * @param valueObject The value object.
        */
  -    void setPropertyValue(short valueObjectType, String valueObject);
  +    void setPropertyValue(int valueObjectType, String valueObject);
   
       /**
        * <p>Getter for the boolean property value.</p>
  
  
  
  1.3       +4 -4      jakarta-jetspeed-2/components/prefs/src/java/org/apache/jetspeed/prefs/om/PropertyKey.java
  
  Index: PropertyKey.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/prefs/src/java/org/apache/jetspeed/prefs/om/PropertyKey.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PropertyKey.java	6 Mar 2004 18:30:27 -0000	1.2
  +++ PropertyKey.java	5 May 2004 18:32:43 -0000	1.3
  @@ -29,13 +29,13 @@
        * <p>Getter for the property key id.</p>
        * @return The property key id.
        */
  -    int getPropertyKeyId();
  +    long getPropertyKeyId();
   
       /**
        * <p>Setter for the property key id.</p>
        * @param propertyKeyId The property key id.
        */
  -    void setPropertyKeyId(int propertyKeyId);
  +    void setPropertyKeyId(long propertyKeyId);
   
       /**
        * <p>Getter for the property key name.</p>
  @@ -60,7 +60,7 @@
        * </ul>
        * @return The property key type.
        */
  -    short getPropertyKeyType();
  +    int getPropertyKeyType();
   
       /**
        * <p>Setter for the property key type.</p>
  @@ -73,7 +73,7 @@
        * </ul>
        * @param propertyKeyType The property key type.
        */
  -    void setPropertyKeyType(short propertyKeyType);
  +    void setPropertyKeyType(int propertyKeyType);
   
       /**
        * <p>Getter for creation date.</p>
  
  
  

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


Mime
View raw message