John - The files that read the schema and generate the SQL aren't really in Ant per
se. It's the Torque add-on to Turbine that reads the schema file
and runs it through some Velocity scripts to produce the SQL files, (ant runs them by
using the taskdefs specified in the build.xml).
Personally I would start my search with the 'newapp' build.xml file and look at the
project-sql, project-om, etc targets. They are really what's
generating the SQL, OM classes, etc.
Possible classes to look into are (I'd start with the torque-sql maybe?)
<target name="init-tasks">
<taskdef name="torque-sql"-
classname="org.apache.turbine.torque.TorqueSQLTask">
<classpath refid="classpath"/>
</taskdef>
<taskdef name="torque-om"-
classname="org.apache.turbine.torque.TorqueObjectModelTask">
<classpath refid="classpath"/>
</taskdef>
<taskdef name="sql-xml"-
classname="org.apache.turbine.torque.TorqueSQLTransformTask">
<classpath refid="classpath"/>
</taskdef>
<taskdef name="texen"-
classname="org.apache.velocity.texen.ant.TexenTask">
<classpath refid="classpath"/>
</taskdef>
</target>
Really you are going to end up writting Velocity scripts to generate the java code.
Hope that helps.
ian
John Menke wrote:
>
> Thanks to a suggestion from Scott Eade (thanks Scott :)) I'm looking into a
> product called EJBDoclet. It's based on Ant and will auto generate EJB's
> based on a combination of XML of java source code that is commented
> correctly. With a few tweaks, it may be possible to integrate this system
> in with the existing TDK build files so that it reads the schema.xml like
> the Torque does and generate the beans automagically.
>
> I have a few questions based on this:
>
> 1. I am proposing that the auto generation process produce 2 beans for each
> table. One entity bean that maps to the table and One Session bean that
> wraps the entity bean. The session bean could be used similar to the way the
> Peer classes are used currently.
>
> -- the problem with this is that beans might be too simple and not do
> exactly what the user wants. I think that some customization will have to
> able to made if the user selects to do so. (EJBDoclet should be able to
> handle this be letting the user specify a base class for the Entity Bean and
> base class for the Session bean)
>
> Question is: Does this represent a valid architecture? (One session bean
> per entity bean?) Or should we try to develop some sort of abstraction where
> one session bean controls many entity beans? Personally, I think that with
> the auto generation the 1/1 mapping of session beans to entity beans will be
> OK.
>
> 2. I am just learning Ant, so it would be helpful if somebody pointed to the
> scripts that read the schema file and generate the SQL. (I will probably be
> able to find them, but at the moment I'm still looking).
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
--
+----------------------------------+
[EMAIL PROTECTED]
+----------------------------------+
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]