jmcnally    01/07/13 14:23:43

  Modified:    src/java/org/apache/turbine/util/db Tag: T_2_1_BRANCH
                        Criteria.java
               src/java/org/apache/turbine/om/security/peer Tag:
                        T_2_1_BRANCH TurbineUserPeer.java
  Log:
  fixes problem for postgres with blob style column in TurbineUser table.  Patch by 
Jerome Veryleyen, slightly modified.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.29.4.9  +24 -1     
jakarta-turbine/src/java/org/apache/turbine/util/db/Attic/Criteria.java
  
  Index: Criteria.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine/src/java/org/apache/turbine/util/db/Attic/Criteria.java,v
  retrieving revision 1.29.4.8
  retrieving revision 1.29.4.9
  diff -u -r1.29.4.8 -r1.29.4.9
  --- Criteria.java     2001/06/04 23:53:30     1.29.4.8
  +++ Criteria.java     2001/07/13 21:23:37     1.29.4.9
  @@ -94,7 +94,7 @@
    * @author <a href="mailto:[EMAIL PROTECTED]";>Brett McLaughlin</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Eric Dobbs</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Henning P. Schmiedehausen</a>
  - * @version $Id: Criteria.java,v 1.29.4.8 2001/06/04 23:53:30 jvanzyl Exp $
  + * @version $Id: Criteria.java,v 1.29.4.9 2001/07/13 21:23:37 jmcnally Exp $
    */
   public class Criteria extends Hashtable
   {
  @@ -210,6 +210,10 @@
   
       private HashMap aliases = null;
   
  +    // flag to note that the criteria involves a blob.
  +    private boolean blobFlag = false;
  +
  +
       /**
        * Creates a new instance with the default capacity.
        */
  @@ -382,6 +386,13 @@
       public boolean containsObjectColumn(String databaseMapName)
           throws Exception
       {
  +        // Peer or application may have noted the existence of a blob
  +        // so we can save the lookup.
  +        if ( blobFlag )
  +        {
  +            return true;
  +        }
  +
           DatabaseMap map = TurbineDB.getDatabaseMap(databaseMapName);
           StringStackBuffer tables = new StringStackBuffer();
           for (Enumeration e = super.elements(); e.hasMoreElements(); )
  @@ -3116,6 +3127,18 @@
       {
           or(column, (Object)values, Criteria.NOT_IN);
           return this;
  +    }
  +
  +    
  +    /**
  +     * Peers can set this flag to notify BasePeer that the table(s) involved
  +     * in the Criteria contain Blobs, so that the operation can be placed
  +     * in a transaction if the db requires it.  
  +     * This is primarily to support Postgresql.
  +     */
  +    public void setBlobFlag() 
  +    {
  +        blobFlag = true;
       }
   
       /**
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.15.4.8  +7 -1      
jakarta-turbine/src/java/org/apache/turbine/om/security/peer/TurbineUserPeer.java
  
  Index: TurbineUserPeer.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine/src/java/org/apache/turbine/om/security/peer/TurbineUserPeer.java,v
  retrieving revision 1.15.4.7
  retrieving revision 1.15.4.8
  diff -u -r1.15.4.7 -r1.15.4.8
  --- TurbineUserPeer.java      2001/06/04 23:53:17     1.15.4.7
  +++ TurbineUserPeer.java      2001/07/13 21:23:41     1.15.4.8
  @@ -86,7 +86,7 @@
    * @author <a href="mailto:[EMAIL PROTECTED]";>Frank Y. Kim</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>John D. McNally</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Brett McLaughlin</a>
  - * @version $Id: TurbineUserPeer.java,v 1.15.4.7 2001/06/04 23:53:17 jvanzyl Exp $
  + * @version $Id: TurbineUserPeer.java,v 1.15.4.8 2001/07/13 21:23:41 jmcnally Exp $
    */
   public class TurbineUserPeer extends BasePeer implements UserPeer
   {
  @@ -346,6 +346,9 @@
                                     User current)
           throws Exception
       {
  +        // stuff for postgresql problem.....
  +        criteria.setBlobFlag();
  +
           // add User table columns
           addSelectColumns(criteria);
           
  @@ -400,6 +403,9 @@
       public static Vector doSelect(Criteria criteria, DBConnection dbConn)
           throws Exception
       {
  +        // stuff for postgresql problem.....
  +        criteria.setBlobFlag();
  +     
           // add User table columns
           addSelectColumns(criteria);
           
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to