You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by Daniel Rall <dl...@finemaltcoding.com> on 2001/10/29 05:25:38 UTC

Torque tied to Intake

I don't understand this commit--it ties Torque to Intake, which is
part of Fulcrum (albeit through a build-time property).  A more
flexible method of supplying interface implementations would be more
desirable--perhaps one should be able to specify a list of fully
qualified interfaces to implement, and two code snippets w/ imports
and implementation corresponding to those interfaces.

Dan


jmcnally@apache.org writes:

> jmcnally    01/10/28 11:46:02
>
>   Modified:    src/conf build.properties
>                src/java/org/apache/torque/om Persistent.java
>                src/templates/om ExtensionObject.vm Object.vm
>   Removed:     src/java/org/apache/torque/om Retrievable.java
>                         Retriever.java RetrieverFactory.java
>                         SecurePersistent.java UnsecurePersistent.java
>                src/java/org/apache/torque/security SecurityException.java
>                         SecurityInfo.java
>   Log:
>   removed the security code I added to torque, but turned out to not work as well
>   as I'd hoped.  Have not had time to improve it, so I am removing it until a
>   better implementation can be agreed on.
>   
>   Also removed the Retrievable interface to intake where it belongs and added
>   a flag to build.properties to turn it off in case it is desired to use torque
>   without intake.
>   
>   Also removed the Retriever* classes as this was another incomplete implementation.
>   
>   Revision  Changes    Path
>   1.4       +1 -1      jakarta-turbine-torque/src/conf/build.properties
>   
>   Index: build.properties
>   ===================================================================
>   RCS file: /home/cvs/jakarta-turbine-torque/src/conf/build.properties,v
>   retrieving revision 1.3
>   retrieving revision 1.4
>   diff -u -r1.3 -r1.4
>   --- build.properties	2001/10/28 18:33:45	1.3
>   +++ build.properties	2001/10/28 19:46:02	1.4
>   @@ -66,10 +66,10 @@
>    targetPackage=org.apache.torque
>    basePrefix=Base
>    addSaveMethod=true
>   -secureSaveMethod=false
>    addGetByNameMethod=true
>    complexObjectModel=true
>    addTimeStamp=true
>   +addIntakeRetrievable=true
>    
>    # -------------------------------------------------------------------
>    # 
>   
>   
>   
>   1.8       +21 -1     jakarta-turbine-torque/src/java/org/apache/torque/om/Persistent.java
>   
>   Index: Persistent.java
>   ===================================================================
>   RCS file: /home/cvs/jakarta-turbine-torque/src/java/org/apache/torque/om/Persistent.java,v
>   retrieving revision 1.7
>   retrieving revision 1.8
>   diff -u -r1.7 -r1.8
>   --- Persistent.java	2001/10/15 16:53:10	1.7
>   +++ Persistent.java	2001/10/28 19:46:02	1.8
>   @@ -61,7 +61,7 @@
>     *
>     * @author <a href="mailto:jmcnally@collab.net">John D. McNally</a>
>     * @author <a href="mailto:fedor@apache.org">Fedor K.</a>
>   - * @version $Id: Persistent.java,v 1.7 2001/10/15 16:53:10 jmcnally Exp $
>   + * @version $Id: Persistent.java,v 1.8 2001/10/28 19:46:02 jmcnally Exp $
>     */
>    public interface Persistent
>    {
>   @@ -120,4 +120,24 @@
>         * @param m The new modified state for the object.
>         */
>        void setModified(boolean m);
>   +
>   +    /**
>   +     * Saves the object.
>   +     */
>   +    void save() throws Exception;
>   +
>   +    /**
>   +     * Stores the object in the database.  If the object is new,
>   +     * it inserts it; otherwise an update is performed.
>   +     */
>   +    void save(String dbName) throws Exception;
>   +
>   +    /**
>   +     * Stores the object in the database.  If the object is new,
>   +     * it inserts it; otherwise an update is performed.  This method
>   +     * is meant to be used as part of a transaction, otherwise use
>   +     * the save() method and the connection details will be handled
>   +     * internally
>   +     */
>   +    void save(DBConnection dbCon) throws Exception;
>    }
>   
>   
>   
>   1.3       +2 -8      jakarta-turbine-torque/src/templates/om/ExtensionObject.vm
>   
>   Index: ExtensionObject.vm
>   ===================================================================
>   RCS file: /home/cvs/jakarta-turbine-torque/src/templates/om/ExtensionObject.vm,v
>   retrieving revision 1.2
>   retrieving revision 1.3
>   diff -u -r1.2 -r1.3
>   --- ExtensionObject.vm	2001/09/10 21:14:02	1.2
>   +++ ExtensionObject.vm	2001/10/28 19:46:02	1.3
>   @@ -10,13 +10,7 @@
>        #set ($abstract = "abstract")
>    #end
>    
>   -#if ($secureSaveMethod)
>   -#set ($interface = "SecurePersistent")
>   -import org.apache.torque.om.SecurePersistent;
>   -#else
>   -#set ($interface = "UnsecurePersistent")
>   -import org.apache.torque.om.UnsecurePersistent;
>   -#end
>   +import org.apache.torque.om.Persistent;
>    
>    /** 
>    #if ($addTimeStamp)
>   @@ -31,6 +25,6 @@
>     */
>    public $!abstract class $table.JavaName 
>        extends ${package}.$basePrefix$table.JavaName
>   -    implements $interface
>   +    implements Persistent
>    {
>    }
>   
>   
>   
>   1.11      +12 -54    jakarta-turbine-torque/src/templates/om/Object.vm
>   
>   Index: Object.vm
>   ===================================================================
>   RCS file: /home/cvs/jakarta-turbine-torque/src/templates/om/Object.vm,v
>   retrieving revision 1.10
>   retrieving revision 1.11
>   diff -u -r1.10 -r1.11
>   --- Object.vm	2001/10/27 21:21:19	1.10
>   +++ Object.vm	2001/10/28 19:46:02	1.11
>   @@ -22,9 +22,8 @@
>    #if ($addSaveMethod)
>    import org.apache.commons.util.ObjectUtils;
>    #end
>   -#if ($secureSaveMethod)
>   -import org.apache.torque.security.SecurityInfo;
>   -import org.apache.torque.security.SecurityException;
>   +#if ($addIntakeRetrievable)
>   +import org.apache.fulcrum.intake.Retrievable;
>    #end
>    
>    /** 
>   @@ -38,7 +37,9 @@
>     * extended all references should be to $table.JavaName 
>     */
>    public abstract class $basePrefix$table.JavaName $extendsBaseClass
>   +#if ($addIntakeRetrievable)
>        implements Retrievable
>   +#end
>    {
>        /** The Peer class */
>        private static final ${table.JavaName}Peer peer = 
>   @@ -753,54 +754,17 @@
>        
>    
>    #if (!$table.isAlias() && $addSaveMethod)
>   -  #if ($secureSaveMethod)
>   -      #set ($secInfosecInfo = "SecurityInfo securityInfo")
>   -      #set ($secInfo = "securityInfo")
>   -      #set ($secComma = ", ")
>   -    /**
>   -     * This method is called first thing in the save methods to allow
>   -     * objects the chance to throw a SecurityException before any changes
>   -     * to the persistent data will occur.  The default implementation throws
>   -     * the SecurityException on a false result from 
>   -     * SecurityInfo.hasPermission()
>   -     */
>   -    protected void checkSecurity($secInfosecInfo)
>   -        throws SecurityException
>   -    {
>   -        if (!securityInfo.hasPermission())
>   -        {
>   -            throw new SecurityException();
>   -        }
>   -    }
>   -  #else
>   -      #set ($secInfosecInfo = "")
>   -      #set ($secInfo = "")
>   -      #set ($secComma = "")
>   -  #end
>    
>        /**
>   -     * Allows objects to perform any logic needed before saving.  This method
>   -     * is called after securityCheck.  The default implementation does nothing.
>   -     */
>   -    protected void doPreSave($secInfosecInfo)
>   -        throws Exception
>   -    {
>   -    }
>   -
>   -    /**
>         * Stores the object in the database.  If the object is new,
>         * it inserts it; otherwise an update is performed.
>         */
>   -    public void save($secInfosecInfo) throws Exception
>   +    public void save() throws Exception
>        {
>     #if ($complexObjectModel)
>                save(${table.JavaName}Peer.getMapBuilder()
>   -                .getDatabaseMap().getName()${secComma}$secInfo);
>   +                .getDatabaseMap().getName());
>     #else
>   -    #if ($secureSaveMethod)
>   -        checkSecurity($secInfo);
>   -    #end
>   -        doPreSave($secInfo);
>            if (isModified())
>            {
>                if (isNew())
>   @@ -825,14 +789,14 @@
>         * in this file instead of in the super class, BaseObject.
>    #end
>         */
>   -    public void save(String dbName${secComma}$secInfosecInfo) throws Exception
>   +    public void save(String dbName) throws Exception
>        {
>            DBConnection dbCon = null;
>     #if ($complexObjectModel)
>            try
>            {
>                dbCon = BasePeer.beginTransaction(dbName);
>   -            save(dbCon${secComma}$secInfo);
>   +            save(dbCon);
>            }
>            catch(Exception e)
>            {
>   @@ -842,10 +806,6 @@
>            BasePeer.commitTransaction(dbCon);
>    
>     #else
>   -    #if ($secureSaveMethod)
>   -        checkSecurity($secInfo);
>   -    #end
>   -        doPreSave($secInfo);
>            if (isModified())
>            {
>                try
>   @@ -884,12 +844,8 @@
>         * the save() method and the connection details will be handled
>         * internally
>         */
>   -    public void save(DBConnection dbCon${secComma}$secInfosecInfo) throws Exception
>   +    public void save(DBConnection dbCon) throws Exception
>        {
>   -    #if ($secureSaveMethod)
>   -        checkSecurity($secInfo);
>   -    #end
>   -        doPreSave($secInfo);
>      #if ($complexObjectModel)
>          if (!alreadyInSave)
>          {
>   @@ -932,7 +888,7 @@
>              {
>                  for (int i=0; i<${collName}.size(); i++)
>                  {
>   -                  ((${className})${collName}.get(i)).save(dbCon${secComma}$secInfo);
>   +                  ((${className})${collName}.get(i)).save(dbCon);
>                  }
>              }
>         #end
>   @@ -1079,6 +1035,7 @@
>    
>    #end ##ends if(!$table.isAlias())
>    
>   +#if ($addIntakeRetrievable)
>        /** 
>         * get an id that differentiates this object from others
>         * of its class.
>   @@ -1104,6 +1061,7 @@
>        {
>            setPrimaryKey(key);
>        }
>   +#end
>    
>    #if (!$table.isAlias())
>        /**
>   
>   
>   
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Torque tied to Intake

Posted by John McNally <jm...@collab.net>.
Daniel Rall wrote:
> 
> John McNally <jm...@collab.net> writes:
> 
> > The Retrievable interface is part of Intake.  The way it was, fulcrum
> > was tied to torque.  I changed it so the interface was in the correct
> > package and then allowed one to build torque code that did
> > not implement the interface, if desired.
> 
> Right.  It's that last bit which is questionable, where there are
> references to Fulcrum in Torque (even if they are not built by
> default).

I think your solution is a great way to go and I would like to code it
when I get the time.  I do not see that happening real soon, so if
anyone else would like to write this functionality it already has the
support of 3 committers.

I do think my solution is much better than the previous workaround. 
Which was to take an interface that belongs in fulcrum and place it in
torque.  This creates a build dependency of intake on torque even though
intake uses nothing from torque but the one interface.  In this solution
torque does not require fulcrum to build and vice versa, it is possible
to generate code that is not dependent on intake, and the interface code
is in the correct package which as one benefit, it makes understanding
the code a lot easier.

Another simple solution was to move the interface to a commons repo, but
I do not like this as the Retrievable interface is defined by Intake. 
It does not make much sense to move an interface out of the package in
which its context is given, just to avoid a dependency.  When the
dependency is only required, if the developer wishes to use the code in
the dependency.

john mcnally

> 
> > Can you explain your preferred solution more, I did not understand
> > the
> >
> > > and two code snippets w/ imports and implementation corresponding
> > > to those interfaces.
> >
> > part.
> 
> Rather than hard-coding the reference to the Fulcrum interface and its
> implementation into the Torque templates, a more generic solution
> could be used instead.
> 
> OM classes could implement a list of interfaces specified by the user,
> for each interface #parse()'ing a corresponding snippet of VTL
> containing the implementation of that interface.
> 
> omInterfaces=com.foo.Bar
> omImplementations=path/to/BarImpl.vm
> 
> BarImpl.vm:
> 
>     public void doBar(Object data)
>     {
>         return data.toString();
>     }
> 
> So, for Retrievable:
> 
> omInterfaces=org.apache.fulcrum.intake.Retrievable
> omImplementations=path/to/RetrievableImpl.vm
> ...
> 
> This is nice in that it allows removal of hard-coded references to
> Fulcrum from the default Torque templates, and allows easier
> extensionability of the default templates (that is, you can add to the
> templates without actually editting them).
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Torque tied to Intake

Posted by Jason van Zyl <jv...@zenplex.com>.
On 10/29/01 4:53 AM, "Daniel Rall" <dl...@finemaltcoding.com> wrote:

> John McNally <jm...@collab.net> writes:
> 
>> The Retrievable interface is part of Intake.  The way it was, fulcrum
>> was tied to torque.  I changed it so the interface was in the correct
>> package and then allowed one to build torque code that did
>> not implement the interface, if desired.
> 
> Right.  It's that last bit which is questionable, where there are
> references to Fulcrum in Torque (even if they are not built by
> default).

I agree.
 
>> Can you explain your preferred solution more, I did not understand
>> the
>> 
>>> and two code snippets w/ imports and implementation corresponding
>>> to those interfaces.
>> 
>> part.
> 
> Rather than hard-coding the reference to the Fulcrum interface and its
> implementation into the Torque templates, a more generic solution
> could be used instead.
> 
> OM classes could implement a list of interfaces specified by the user,
> for each interface #parse()'ing a corresponding snippet of VTL
> containing the implementation of that interface.
> 
> omInterfaces=com.foo.Bar
> omImplementations=path/to/BarImpl.vm
> 
> BarImpl.vm:
> 
>   public void doBar(Object data)
>   {
>       return data.toString();
>   }
> 
> So, for Retrievable:
> 
> omInterfaces=org.apache.fulcrum.intake.Retrievable
> omImplementations=path/to/RetrievableImpl.vm
> ...
> 
> This is nice in that it allows removal of hard-coded references to
> Fulcrum from the default Torque templates, and allows easier
> extensionability of the default templates (that is, you can add to the
> templates without actually editting them).

Off the top of my head that sounds like a snazzy idea to me :-)
 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>

-- 

jvz.

Jason van Zyl

http://tambora.zenplex.org
http://jakarta.apache.org/turbine
http://jakarta.apache.org/velocity
http://jakarta.apache.org/alexandria
http://jakarta.apache.org/commons



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Torque tied to Intake

Posted by Daniel Rall <dl...@finemaltcoding.com>.
John McNally <jm...@collab.net> writes:

> The Retrievable interface is part of Intake.  The way it was, fulcrum
> was tied to torque.  I changed it so the interface was in the correct
> package and then allowed one to build torque code that did
> not implement the interface, if desired.

Right.  It's that last bit which is questionable, where there are
references to Fulcrum in Torque (even if they are not built by
default).

> Can you explain your preferred solution more, I did not understand
> the
>
> > and two code snippets w/ imports and implementation corresponding
> > to those interfaces.
>
> part.

Rather than hard-coding the reference to the Fulcrum interface and its
implementation into the Torque templates, a more generic solution
could be used instead.

OM classes could implement a list of interfaces specified by the user,
for each interface #parse()'ing a corresponding snippet of VTL
containing the implementation of that interface.

omInterfaces=com.foo.Bar
omImplementations=path/to/BarImpl.vm

BarImpl.vm:

    public void doBar(Object data)
    {
        return data.toString();
    }

So, for Retrievable:

omInterfaces=org.apache.fulcrum.intake.Retrievable
omImplementations=path/to/RetrievableImpl.vm
...

This is nice in that it allows removal of hard-coded references to
Fulcrum from the default Torque templates, and allows easier
extensionability of the default templates (that is, you can add to the
templates without actually editting them).

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Torque tied to Intake

Posted by John McNally <jm...@collab.net>.
The Retrievable interface is part of Intake.  The way it was, fulcrum
was tied to torque.  I changed it so the interface was in the correct
package and then allowed one to build torque code that did
not implement the interface, if desired.  Can you explain your preferred
solution more, I did not understand the 

and two code snippets w/ imports
> and implementation corresponding to those interfaces.

part.

john mcnally


Daniel Rall wrote:
> 
> I don't understand this commit--it ties Torque to Intake, which is
> part of Fulcrum (albeit through a build-time property).  A more
> flexible method of supplying interface implementations would be more
> desirable--perhaps one should be able to specify a list of fully
> qualified interfaces to implement, and two code snippets w/ imports
> and implementation corresponding to those interfaces.
> 
> Dan
> 
> jmcnally@apache.org writes:
> 
> > jmcnally    01/10/28 11:46:02
> >
> >   Modified:    src/conf build.properties
> >                src/java/org/apache/torque/om Persistent.java
> >                src/templates/om ExtensionObject.vm Object.vm
> >   Removed:     src/java/org/apache/torque/om Retrievable.java
> >                         Retriever.java RetrieverFactory.java
> >                         SecurePersistent.java UnsecurePersistent.java
> >                src/java/org/apache/torque/security SecurityException.java
> >                         SecurityInfo.java
> >   Log:
> >   removed the security code I added to torque, but turned out to not work as well
> >   as I'd hoped.  Have not had time to improve it, so I am removing it until a
> >   better implementation can be agreed on.
> >
> >   Also removed the Retrievable interface to intake where it belongs and added
> >   a flag to build.properties to turn it off in case it is desired to use torque
> >   without intake.
> >
> >   Also removed the Retriever* classes as this was another incomplete implementation.
> >
> >   Revision  Changes    Path
> >   1.4       +1 -1      jakarta-turbine-torque/src/conf/build.properties
> >
> >   Index: build.properties
> >   ===================================================================
> >   RCS file: /home/cvs/jakarta-turbine-torque/src/conf/build.properties,v
> >   retrieving revision 1.3
> >   retrieving revision 1.4
> >   diff -u -r1.3 -r1.4
> >   --- build.properties        2001/10/28 18:33:45     1.3
> >   +++ build.properties        2001/10/28 19:46:02     1.4
> >   @@ -66,10 +66,10 @@
> >    targetPackage=org.apache.torque
> >    basePrefix=Base
> >    addSaveMethod=true
> >   -secureSaveMethod=false
> >    addGetByNameMethod=true
> >    complexObjectModel=true
> >    addTimeStamp=true
> >   +addIntakeRetrievable=true
> >
> >    # -------------------------------------------------------------------
> >    #
> >
> >
> >
> >   1.8       +21 -1     jakarta-turbine-torque/src/java/org/apache/torque/om/Persistent.java
> >
> >   Index: Persistent.java
> >   ===================================================================
> >   RCS file: /home/cvs/jakarta-turbine-torque/src/java/org/apache/torque/om/Persistent.java,v
> >   retrieving revision 1.7
> >   retrieving revision 1.8
> >   diff -u -r1.7 -r1.8
> >   --- Persistent.java 2001/10/15 16:53:10     1.7
> >   +++ Persistent.java 2001/10/28 19:46:02     1.8
> >   @@ -61,7 +61,7 @@
> >     *
> >     * @author <a href="mailto:jmcnally@collab.net">John D. McNally</a>
> >     * @author <a href="mailto:fedor@apache.org">Fedor K.</a>
> >   - * @version $Id: Persistent.java,v 1.7 2001/10/15 16:53:10 jmcnally Exp $
> >   + * @version $Id: Persistent.java,v 1.8 2001/10/28 19:46:02 jmcnally Exp $
> >     */
> >    public interface Persistent
> >    {
> >   @@ -120,4 +120,24 @@
> >         * @param m The new modified state for the object.
> >         */
> >        void setModified(boolean m);
> >   +
> >   +    /**
> >   +     * Saves the object.
> >   +     */
> >   +    void save() throws Exception;
> >   +
> >   +    /**
> >   +     * Stores the object in the database.  If the object is new,
> >   +     * it inserts it; otherwise an update is performed.
> >   +     */
> >   +    void save(String dbName) throws Exception;
> >   +
> >   +    /**
> >   +     * Stores the object in the database.  If the object is new,
> >   +     * it inserts it; otherwise an update is performed.  This method
> >   +     * is meant to be used as part of a transaction, otherwise use
> >   +     * the save() method and the connection details will be handled
> >   +     * internally
> >   +     */
> >   +    void save(DBConnection dbCon) throws Exception;
> >    }
> >
> >
> >
> >   1.3       +2 -8      jakarta-turbine-torque/src/templates/om/ExtensionObject.vm
> >
> >   Index: ExtensionObject.vm
> >   ===================================================================
> >   RCS file: /home/cvs/jakarta-turbine-torque/src/templates/om/ExtensionObject.vm,v
> >   retrieving revision 1.2
> >   retrieving revision 1.3
> >   diff -u -r1.2 -r1.3
> >   --- ExtensionObject.vm      2001/09/10 21:14:02     1.2
> >   +++ ExtensionObject.vm      2001/10/28 19:46:02     1.3
> >   @@ -10,13 +10,7 @@
> >        #set ($abstract = "abstract")
> >    #end
> >
> >   -#if ($secureSaveMethod)
> >   -#set ($interface = "SecurePersistent")
> >   -import org.apache.torque.om.SecurePersistent;
> >   -#else
> >   -#set ($interface = "UnsecurePersistent")
> >   -import org.apache.torque.om.UnsecurePersistent;
> >   -#end
> >   +import org.apache.torque.om.Persistent;
> >
> >    /**
> >    #if ($addTimeStamp)
> >   @@ -31,6 +25,6 @@
> >     */
> >    public $!abstract class $table.JavaName
> >        extends ${package}.$basePrefix$table.JavaName
> >   -    implements $interface
> >   +    implements Persistent
> >    {
> >    }
> >
> >
> >
> >   1.11      +12 -54    jakarta-turbine-torque/src/templates/om/Object.vm
> >
> >   Index: Object.vm
> >   ===================================================================
> >   RCS file: /home/cvs/jakarta-turbine-torque/src/templates/om/Object.vm,v
> >   retrieving revision 1.10
> >   retrieving revision 1.11
> >   diff -u -r1.10 -r1.11
> >   --- Object.vm       2001/10/27 21:21:19     1.10
> >   +++ Object.vm       2001/10/28 19:46:02     1.11
> >   @@ -22,9 +22,8 @@
> >    #if ($addSaveMethod)
> >    import org.apache.commons.util.ObjectUtils;
> >    #end
> >   -#if ($secureSaveMethod)
> >   -import org.apache.torque.security.SecurityInfo;
> >   -import org.apache.torque.security.SecurityException;
> >   +#if ($addIntakeRetrievable)
> >   +import org.apache.fulcrum.intake.Retrievable;
> >    #end
> >
> >    /**
> >   @@ -38,7 +37,9 @@
> >     * extended all references should be to $table.JavaName
> >     */
> >    public abstract class $basePrefix$table.JavaName $extendsBaseClass
> >   +#if ($addIntakeRetrievable)
> >        implements Retrievable
> >   +#end
> >    {
> >        /** The Peer class */
> >        private static final ${table.JavaName}Peer peer =
> >   @@ -753,54 +754,17 @@
> >
> >
> >    #if (!$table.isAlias() && $addSaveMethod)
> >   -  #if ($secureSaveMethod)
> >   -      #set ($secInfosecInfo = "SecurityInfo securityInfo")
> >   -      #set ($secInfo = "securityInfo")
> >   -      #set ($secComma = ", ")
> >   -    /**
> >   -     * This method is called first thing in the save methods to allow
> >   -     * objects the chance to throw a SecurityException before any changes
> >   -     * to the persistent data will occur.  The default implementation throws
> >   -     * the SecurityException on a false result from
> >   -     * SecurityInfo.hasPermission()
> >   -     */
> >   -    protected void checkSecurity($secInfosecInfo)
> >   -        throws SecurityException
> >   -    {
> >   -        if (!securityInfo.hasPermission())
> >   -        {
> >   -            throw new SecurityException();
> >   -        }
> >   -    }
> >   -  #else
> >   -      #set ($secInfosecInfo = "")
> >   -      #set ($secInfo = "")
> >   -      #set ($secComma = "")
> >   -  #end
> >
> >        /**
> >   -     * Allows objects to perform any logic needed before saving.  This method
> >   -     * is called after securityCheck.  The default implementation does nothing.
> >   -     */
> >   -    protected void doPreSave($secInfosecInfo)
> >   -        throws Exception
> >   -    {
> >   -    }
> >   -
> >   -    /**
> >         * Stores the object in the database.  If the object is new,
> >         * it inserts it; otherwise an update is performed.
> >         */
> >   -    public void save($secInfosecInfo) throws Exception
> >   +    public void save() throws Exception
> >        {
> >     #if ($complexObjectModel)
> >                save(${table.JavaName}Peer.getMapBuilder()
> >   -                .getDatabaseMap().getName()${secComma}$secInfo);
> >   +                .getDatabaseMap().getName());
> >     #else
> >   -    #if ($secureSaveMethod)
> >   -        checkSecurity($secInfo);
> >   -    #end
> >   -        doPreSave($secInfo);
> >            if (isModified())
> >            {
> >                if (isNew())
> >   @@ -825,14 +789,14 @@
> >         * in this file instead of in the super class, BaseObject.
> >    #end
> >         */
> >   -    public void save(String dbName${secComma}$secInfosecInfo) throws Exception
> >   +    public void save(String dbName) throws Exception
> >        {
> >            DBConnection dbCon = null;
> >     #if ($complexObjectModel)
> >            try
> >            {
> >                dbCon = BasePeer.beginTransaction(dbName);
> >   -            save(dbCon${secComma}$secInfo);
> >   +            save(dbCon);
> >            }
> >            catch(Exception e)
> >            {
> >   @@ -842,10 +806,6 @@
> >            BasePeer.commitTransaction(dbCon);
> >
> >     #else
> >   -    #if ($secureSaveMethod)
> >   -        checkSecurity($secInfo);
> >   -    #end
> >   -        doPreSave($secInfo);
> >            if (isModified())
> >            {
> >                try
> >   @@ -884,12 +844,8 @@
> >         * the save() method and the connection details will be handled
> >         * internally
> >         */
> >   -    public void save(DBConnection dbCon${secComma}$secInfosecInfo) throws Exception
> >   +    public void save(DBConnection dbCon) throws Exception
> >        {
> >   -    #if ($secureSaveMethod)
> >   -        checkSecurity($secInfo);
> >   -    #end
> >   -        doPreSave($secInfo);
> >      #if ($complexObjectModel)
> >          if (!alreadyInSave)
> >          {
> >   @@ -932,7 +888,7 @@
> >              {
> >                  for (int i=0; i<${collName}.size(); i++)
> >                  {
> >   -                  ((${className})${collName}.get(i)).save(dbCon${secComma}$secInfo);
> >   +                  ((${className})${collName}.get(i)).save(dbCon);
> >                  }
> >              }
> >         #end
> >   @@ -1079,6 +1035,7 @@
> >
> >    #end ##ends if(!$table.isAlias())
> >
> >   +#if ($addIntakeRetrievable)
> >        /**
> >         * get an id that differentiates this object from others
> >         * of its class.
> >   @@ -1104,6 +1061,7 @@
> >        {
> >            setPrimaryKey(key);
> >        }
> >   +#end
> >
> >    #if (!$table.isAlias())
> >        /**
> >
> >
> >
> >
> > --
> > To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> > For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>